Skip to content

Commit 72354c4

Browse files
committed
chore: Remove the deprecated limitedErrorInfo from tests
1 parent 09e3977 commit 72354c4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/parse1.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var oldNode = process.version.startsWith('v4.')
1515
var nativeParser = process.argv[2] === '--native-parser'
1616
parse = nativeParser ? exported.parseNative : exported.parseCustom
1717

18-
function checkLimitedErrorInformation (error) {
18+
function checkErrorInformation (error) {
1919
assert.equal(typeof error.message, 'string')
2020
assert.equal(typeof error.reason, 'string')
2121
assert.equal(typeof error.exzerpt, 'string')
@@ -69,14 +69,13 @@ if (!nativeParser) {
6969
exports['test limited error information'] = function () {
7070
var json = '{"foo": ?}'
7171
var parser = new Parser({
72-
ignoreComments: true,
73-
limitedErrorInfo: true
72+
ignoreComments: true
7473
})
7574
try {
7675
parser.parse(json)
7776
assert.fail()
7877
} catch (error) {
79-
checkLimitedErrorInformation(error)
78+
checkErrorInformation(error)
8079
}
8180
}
8281
} else {
@@ -86,7 +85,7 @@ if (!nativeParser) {
8685
parse(json)
8786
assert.fail()
8887
} catch (error) {
89-
checkLimitedErrorInformation(error)
88+
checkErrorInformation(error)
9089
}
9190
}
9291
}
@@ -328,12 +327,12 @@ exports['test schema validation failure'] = function () {
328327
var data = fs.readFileSync(path.join(__dirname, '/passes/3.schema.json')).toString()
329328
var schema = fs.readFileSync(path.join(__dirname, '/passes/3.schema.json')).toString()
330329
var validate = validator.compile(schema, {
331-
limitedErrorInfo: nativeParser,
330+
ignoreComments: !nativeParser,
332331
environment: 'json-schema-draft-04'
333332
})
334333
assert['throws'](function () {
335334
validate(parse(data, {
336-
limitedErrorInfo: nativeParser
335+
ignoreComments: !nativeParser
337336
}))
338337
}, 'should throw error')
339338
}

0 commit comments

Comments
 (0)