<commit_before>import test = require('tape')
import runLifecycleHook, {runPostinstallHooks} from '@pnpm/lifecycle'
import path = require('path')

const fixtures = path.join(__dirname, 'fixtures')
const rootNodeModulesDir = path.join(__dirname, '..', 'node_modules')

test('runLifecycleHook()', async (t) => {
  const pkgRoot = path.join(fixtures, 'simple')
  const pkg = require(path.join(pkgRoot, 'package.json'))
  await runLifecycleHook('postinstall', pkg, {
    rootNodeModulesDir,
    pkgId: '/simple/1.0.0',
    rawNpmConfig: {},
    pkgRoot,
    unsafePerm: true,
    userAgent: 'pnpm',
  })

  t.deepEqual(require(path.join(pkgRoot, 'output.json')), ['install'])

  t.end()
})

test('runLifecycleHook()', async (t) => {
  const pkgRoot = path.join(fixtures, 'with-many-scripts')
  const pkg = require(path.join(pkgRoot, 'package.json'))
  await runPostinstallHooks({
    rootNodeModulesDir,
    pkgId: '/with-many-scripts/1.0.0',
    rawNpmConfig: {},
    pkgRoot,
    unsafePerm: true,
    userAgent: 'pnpm',
  })

  t.deepEqual(require(path.join(pkgRoot, 'output.json')), ['preinstall', 'install', 'postinstall'])

  t.end()
})
<commit_msg>test: fix test name<commit_after>import test = require('tape')
import runLifecycleHook, {runPostinstallHooks} from '@pnpm/lifecycle'
import path = require('path')

const fixtures = path.join(__dirname, 'fixtures')
const rootNodeModulesDir = path.join(__dirname, '..', 'node_modules')

test('runLifecycleHook()', async (t) => {
  const pkgRoot = path.join(fixtures, 'simple')
  const pkg = require(path.join(pkgRoot, 'package.json'))
  await runLifecycleHook('postinstall', pkg, {
    rootNodeModulesDir,
    pkgId: '/simple/1.0.0',
    rawNpmConfig: {},
    pkgRoot,
    unsafePerm: true,
    userAgent: 'pnpm',
  })

  t.deepEqual(require(path.join(pkgRoot, 'output.json')), ['install'])

  t.end()
})

test('runPostinstallHooks()', async (t) => {
  const pkgRoot = path.join(fixtures, 'with-many-scripts')
  const pkg = require(path.join(pkgRoot, 'package.json'))
  await runPostinstallHooks({
    rootNodeModulesDir,
    pkgId: '/with-many-scripts/1.0.0',
    rawNpmConfig: {},
    pkgRoot,
    unsafePerm: true,
    userAgent: 'pnpm',
  })

  t.deepEqual(require(path.join(pkgRoot, 'output.json')), ['preinstall', 'install', 'postinstall'])

  t.end()
})

{'fraction_non_alphanumeric': 0.17453443048938935, 'fraction_numerical': 0.00519705500216544, 'mean_word_length': 4.606796116504855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1145616', 'n_tokens_mistral': 826, 'n_tokens_neox': 807, 'n_words': 151}