node/deps/npm/node_modules/node-gyp/test/test-create-config-gypi.js
npm team 9843885e93 deps: upgrade npm to 8.1.1
PR-URL: https://github.com/nodejs/node/pull/40554
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-10-23 06:17:03 -07:00

38 lines
1013 B
JavaScript

'use strict'
const { test } = require('tap')
const gyp = require('../lib/node-gyp')
const createConfigGypi = require('../lib/create-config-gypi')
const { getCurrentConfigGypi } = createConfigGypi.test
test('config.gypi with no options', function (t) {
t.plan(2)
const prog = gyp()
prog.parseArgv([])
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
t.equal(config.target_defaults.default_configuration, 'Release')
t.equal(config.variables.target_arch, process.arch)
})
test('config.gypi with --debug', function (t) {
t.plan(1)
const prog = gyp()
prog.parseArgv(['_', '_', '--debug'])
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
t.equal(config.target_defaults.default_configuration, 'Debug')
})
test('config.gypi with custom options', function (t) {
t.plan(1)
const prog = gyp()
prog.parseArgv(['_', '_', '--shared-libxml2'])
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
t.equal(config.variables.shared_libxml2, true)
})