PHP 8.2.30
Preview: test.js Size: 1017 B
/opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules/worker-farm/node_modules/errno/test.js

#!/opt/alt/alt-nodejs9/root/usr/bin/node

var test  = require('tape')
  , errno = require('./')

test('sanity checks', function (t) {
  t.ok(errno.all, 'errno.all not found')
  t.ok(errno.errno, 'errno.errno not found')
  t.ok(errno.code, 'errno.code not found')

  t.equal(errno.all.length, 59, 'found ' + errno.all.length + ', expected 59')
  t.equal(errno.errno['-1'], errno.all[0], 'errno -1 not first element')

  t.equal(errno.code['UNKNOWN'], errno.all[0], 'code UNKNOWN not first element')

  t.equal(errno.errno[1], errno.all[2], 'errno 1 not third element')

  t.equal(errno.code['EOF'], errno.all[2], 'code EOF not third element')
  t.end()
})

test('custom errors', function (t) {
  var Cust = errno.create('FooNotBarError')
  var cust = new Cust('foo is not bar')

  t.equal(cust.name, 'FooNotBarError', 'correct custom name')
  t.equal(cust.type, 'FooNotBarError', 'correct custom type')
  t.equal(cust.message, 'foo is not bar', 'correct custom message')
  t.notOk(cust.cause, 'no cause')
  t.end()
})

Directory Contents

Dirs: 1 × Files: 8

Name Size Perms Modified Actions
- drwxr-xr-x 2024-03-03 22:42:04
Edit Download
12 B lrw-r--r-- 2021-09-28 11:28:13
Edit Download
1.13 KB lrwxr-xr-x 2021-09-28 11:28:13
Edit Download
445 B lrwxr-xr-x 2021-09-28 11:28:12
Edit Download
1.60 KB lrw-r--r-- 2021-09-28 11:28:12
Edit Download
5.48 KB lrw-r--r-- 2021-09-28 11:28:13
Edit Download
1.43 KB lrw-r--r-- 2021-09-28 11:28:13
Edit Download
4.31 KB lrw-r--r-- 2021-09-28 11:28:12
Edit Download
1017 B lrwxr-xr-x 2021-09-28 11:28:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).