diff options
author | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 20:05:50 +0100 |
---|---|---|
committer | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-01 20:05:50 +0100 |
commit | 291803c31f829fe0d32bb3207bc11def95a7408c (patch) | |
tree | c7d43107d79291b19d8c9eceefbe91c9f9a52acf /sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js | |
parent | 1fa69862057db4db53cfda5be9c24b4228ef63f7 (diff) |
Urađena test aplikacija. Povezan front i back.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js b/sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js new file mode 100644 index 00000000..eeac73fa --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/node-gyp/test/test-create-config-gypi.js @@ -0,0 +1,70 @@ +'use strict' + +const path = require('path') +const { test } = require('tap') +const gyp = require('../lib/node-gyp') +const createConfigGypi = require('../lib/create-config-gypi') +const { parseConfigGypi, getCurrentConfigGypi } = createConfigGypi.test + +test('config.gypi with no options', async function (t) { + t.plan(2) + + const prog = gyp() + prog.parseArgv([]) + + const config = await 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', async function (t) { + t.plan(1) + + const prog = gyp() + prog.parseArgv(['_', '_', '--debug']) + + const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) + t.equal(config.target_defaults.default_configuration, 'Debug') +}) + +test('config.gypi with custom options', async function (t) { + t.plan(1) + + const prog = gyp() + prog.parseArgv(['_', '_', '--shared-libxml2']) + + const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) + t.equal(config.variables.shared_libxml2, true) +}) + +test('config.gypi with nodedir', async function (t) { + t.plan(1) + + const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') + + const prog = gyp() + prog.parseArgv(['_', '_', `--nodedir=${nodeDir}`]) + + const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) + t.equal(config.variables.build_with_electron, true) +}) + +test('config.gypi with --force-process-config', async function (t) { + t.plan(1) + + const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') + + const prog = gyp() + prog.parseArgv(['_', '_', '--force-process-config', `--nodedir=${nodeDir}`]) + + const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) + t.equal(config.variables.build_with_electron, undefined) +}) + +test('config.gypi parsing', function (t) { + t.plan(1) + + const str = "# Some comments\n{'variables': {'multiline': 'A'\n'B'}}" + const config = parseConfigGypi(str) + t.deepEqual(config, { variables: { multiline: 'AB' } }) +}) |