mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 10:54:13 +00:00

Contains the following three npm releases: https://github.com/npm/npm/releases/tag/v3.8.7 https://github.com/npm/npm/releases/tag/v3.8.8 https://github.com/npm/npm/releases/tag/v3.8.9 PR-URL: https://github.com/nodejs/node/pull/6664 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
21 lines
534 B
JavaScript
21 lines
534 B
JavaScript
var tap = require('tap')
|
|
var readJson = require('../')
|
|
var path = require('path')
|
|
var p = path.resolve(__dirname, 'fixtures/erroneous.json')
|
|
|
|
tap.test('erroneous package data', function (t) {
|
|
readJson(p, function (er, data) {
|
|
t.ok(er instanceof Error)
|
|
t.ok(er.message.match(/Unexpected token '\\''/))
|
|
t.end()
|
|
})
|
|
})
|
|
|
|
tap.test('ENOTDIR for non-directory packages', function (t) {
|
|
readJson(path.resolve(__filename, 'package.json'), function (er, data) {
|
|
t.ok(er)
|
|
t.equal(er.code, 'ENOTDIR')
|
|
t.end()
|
|
})
|
|
})
|