Typo: noneCode => nonCode (#607)

This commit is contained in:
Adam Chalmers
2023-09-18 17:14:12 -06:00
committed by GitHub
parent 76e3207251
commit 24a31c94e7
7 changed files with 96 additions and 96 deletions

View File

@ -1512,7 +1512,7 @@ const yo = { a: { b: { c: '123' } } }
// this is a comment
const key = 'c'`
const nonCodeMetaInstance = {
type: 'NoneCodeNode',
type: 'NonCodeNode',
start: code.indexOf('\n// this is a comment'),
end: code.indexOf('const key'),
value: {
@ -1521,17 +1521,17 @@ const key = 'c'`
},
}
const { nonCodeMeta } = parser_wasm(code)
expect(nonCodeMeta.noneCodeNodes[0]).toEqual(nonCodeMetaInstance)
expect(nonCodeMeta.nonCodeNodes[0]).toEqual(nonCodeMetaInstance)
// extra whitespace won't change it's position (0) or value (NB the start end would have changed though)
const codeWithExtraStartWhitespace = '\n\n\n' + code
const { nonCodeMeta: nonCodeMeta2 } = parser_wasm(
codeWithExtraStartWhitespace
)
expect(nonCodeMeta2.noneCodeNodes[0].value).toStrictEqual(
expect(nonCodeMeta2.nonCodeNodes[0].value).toStrictEqual(
nonCodeMetaInstance.value
)
expect(nonCodeMeta2.noneCodeNodes[0].start).not.toBe(
expect(nonCodeMeta2.nonCodeNodes[0].start).not.toBe(
nonCodeMetaInstance.start
)
})
@ -1548,9 +1548,9 @@ const key = 'c'`
const { body } = parser_wasm(code)
const indexOfSecondLineToExpression = 2
const sketchNonCodeMeta = (body as any)[0].declarations[0].init.nonCodeMeta
.noneCodeNodes
.nonCodeNodes
expect(sketchNonCodeMeta[indexOfSecondLineToExpression]).toEqual({
type: 'NoneCodeNode',
type: 'NonCodeNode',
start: 106,
end: 166,
value: {
@ -1571,9 +1571,9 @@ const key = 'c'`
const { body } = parser_wasm(code)
const sketchNonCodeMeta = (body[0] as any).declarations[0].init.nonCodeMeta
.noneCodeNodes
.nonCodeNodes
expect(sketchNonCodeMeta[3]).toEqual({
type: 'NoneCodeNode',
type: 'NonCodeNode',
start: 125,
end: 141,
value: {