403Webshell
Server IP : 159.69.118.108  /  Your IP : 216.73.216.231
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ubuntu-4gb-fsn1-1 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 13:53:54 UTC 2025 aarch64
User : root ( 0)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/node_modules/npm/node_modules/node-gyp/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/node_modules/npm/node_modules/node-gyp/test/test-options.js
'use strict'

const { describe, it } = require('mocha')
const assert = require('assert')
const gyp = require('../lib/node-gyp')

describe('options', function () {
  it('options in environment', () => {
    // `npm test` dumps a ton of npm_config_* variables in the environment.
    Object.keys(process.env)
      .filter((key) => /^npm_config_/.test(key))
      .forEach((key) => { delete process.env[key] })

    // in some platforms, certain keys are stubborn and cannot be removed
    const keys = Object.keys(process.env)
      .filter((key) => /^npm_config_/.test(key))
      .map((key) => key.substring('npm_config_'.length))
      .concat('argv', 'x')

    // Zero-length keys should get filtered out.
    process.env.npm_config_ = '42'
    // Other keys should get added.
    process.env.npm_config_x = '42'
    // Except loglevel.
    process.env.npm_config_loglevel = 'debug'

    const g = gyp()
    g.parseArgv(['rebuild']) // Also sets opts.argv.

    assert.deepStrictEqual(Object.keys(g.opts).sort(), keys.sort())
  })

  it('options with spaces in environment', () => {
    process.env.npm_config_force_process_config = 'true'

    const g = gyp()
    g.parseArgv(['rebuild']) // Also sets opts.argv.

    assert.strictEqual(g.opts['force-process-config'], 'true')
  })
})

Youez - 2016 - github.com/yon3zu
LinuXploit