Skip to content

Commit 88a93af

Browse files
committed
Updating tests
1 parent c16eddf commit 88a93af

18 files changed

+252
-160
lines changed

src/parser/__tests__/__snapshots__/allowed-syntax.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407862,7 +407862,7 @@ function stream_ref(s, n) {
407862407862
}
407863407863
`;
407864407864

407865-
exports[`Syntaxes are allowed in the chapter they are introduced 38 1`] = `"Line 4: Export default declarations are not allowed"`;
407865+
exports[`Syntaxes are allowed in the chapter they are introduced 38 1`] = `"Line 4: Export default declarations are not allowed."`;
407866407866

407867407867
exports[`Syntaxes are allowed in the chapter they are introduced 38 2`] = `
407868407868
Object {
@@ -419449,6 +419449,6 @@ function stream_ref(s, n) {
419449419449
}
419450419450
`;
419451419451

419452-
exports[`Syntaxes are allowed in the chapter they are introduced 39 1`] = `"Line 1: Import default specifiers are not allowed"`;
419452+
exports[`Syntaxes are allowed in the chapter they are introduced 39 1`] = `"Line 1: Import default specifiers are not allowed."`;
419453419453

419454419454
exports[`Syntaxes are allowed in the chapter they are introduced 40 1`] = `"Line 1: Namespace imports are not allowed"`;

src/parser/__tests__/allowed-syntax.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Chapter } from '../../types'
1+
import { Chapter, Variant } from '../../types'
22
import { stripIndent } from '../../utils/formatters'
3-
import { snapshotFailure, snapshotSuccess } from '../../utils/testing'
3+
import { snapshotFailure, snapshotSuccess, testSuccess } from '../../utils/testing'
4+
import { expectFinishedResultValue } from '../../utils/testing/misc'
45

56
jest.mock('../../modules/loader/loaders')
67

@@ -354,3 +355,8 @@ test.each([
354355
return Promise.all(tests)
355356
}
356357
)
358+
359+
test('typeof operator is allowed in typed variant', async () => {
360+
const { result } = await testSuccess(`typeof "0";`, { variant: Variant.TYPED })
361+
expectFinishedResultValue(result, 'string')
362+
})

0 commit comments

Comments
 (0)