VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/local/lib/node_modules/npm/node_modules/promzard/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/node_modules/npm/node_modules/promzard/test/buffer.js
var tap = require('tap')
var pz = require('../promzard.js')
var spawn = require('child_process').spawn

tap.test('run the example using a buffer', function (t) {

  var example = require.resolve('../example/buffer.js')
  var node = process.execPath

  var expect =  {
    "name": "example",
    "version": "0.0.0",
    "description": "testing description",
    "main": "test-entry.js",
    "directories": {
      "example": "example",
      "test": "test"
    },
    "dependencies": {},
    "devDependencies": {
      "tap": "~0.2.5"
    },
    "scripts": {
      "test": "tap test/*.js"
    },
    "repository": {
      "type": "git",
      "url": "git://github.com/substack/example.git"
    },
    "homepage": "https://github.com/substack/example",
    "keywords": [
      "fugazi",
      "function",
      "waiting",
      "room"
    ],
    "author": {
      "name": "James Halliday",
      "email": "mail@substack.net",
      "url": "http://substack.net"
    },
    "license": "MIT",
    "engine": {
      "node": ">=0.6"
    }
  }

  var c = spawn(node, [example], { customFds: [-1,-1,-1] })
  var output = ''
  c.stdout.on('data', function (d) {
    output += d
    respond()
  })

  var actual = ''
  c.stderr.on('data', function (d) {
    actual += d
  })

  function respond () {
    if (output.match(/description: $/)) {
      c.stdin.write('testing description\n')
      return
    }
    if (output.match(/entry point: \(index\.js\) $/)) {
      c.stdin.write('test-entry.js\n')
      return
    }
    if (output.match(/keywords: $/)) {
      c.stdin.write('fugazi function waiting room\n')
      // "read" module is weird on node >= 0.10 when not a TTY
      // requires explicit ending for reasons.
      // could dig in, but really just wanna make tests pass, whatever.
      c.stdin.end()
      return
    }
  }

  c.on('close', function () {
    actual = JSON.parse(actual)
    t.deepEqual(actual, expect)
    t.end()
  })
})

VaKeR 2022