Welcome to mirror list, hosted at ThFree Co, Russian Federation.

load-all.js « lib « test « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6e407805346d5bc7b31c24832ad673a34c72e18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const t = require('tap')
const glob = require('glob')
const { resolve } = require('path')

const full = process.env.npm_lifecycle_event === 'check-coverage'

if (!full)
  t.pass('nothing to do here, not checking for full coverage')
else {
  // some files do config.get() on load, so have to load npm first
  const npm = require('../../lib/npm.js')
  t.test('load npm first', t => npm.load(t.end))

  t.test('load all the files', t => {
    // just load all the files so we measure coverage for the missing tests
    const dir = resolve(__dirname, '../../lib')
    for (const f of glob.sync(`${dir}/**/*.js`)) {
      require(f)
      t.pass('loaded ' + f)
    }
    t.pass('loaded all files')
    t.end()
  })

  t.test('call the exit handler so we dont freak out', t => {
    const exitHandler = require('../../lib/utils/exit-handler.js')
    exitHandler.setNpm(npm)
    exitHandler()
    t.end()
  })
}