Skip to content

Commit 428cfa5

Browse files
committed
test use strict
1 parent 4a7c331 commit 428cfa5

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

pnpm-lock.yaml

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/shims/index.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os from 'node:os';
12
import path, { join } from 'node:path';
23
import { pathToFileURL } from 'node:url';
34
import vm from 'node:vm';
@@ -95,10 +96,11 @@ describe('CJS shims', () => {
9596
const fileUrl = pathToFileURL(entryFiles.cjs).href;
9697
expect(importMetaUrl).toBe(fileUrl);
9798
expect(requiredModule).toBe('ok');
98-
expect(cjsCode.startsWith('"use strict"')).toBe(true);
99-
expect(cjsCode).toContain(
100-
'const __rslib_import_meta_url__ = /*#__PURE__*/ function() {',
101-
);
99+
expect(
100+
cjsCode.startsWith(
101+
`"use strict";${os.EOL}const __rslib_import_meta_url__ = /*#__PURE__*/ function() {`,
102+
),
103+
).toBe(true);
102104
});
103105

104106
test('ESM should not be affected by CJS shims configuration', async () => {

0 commit comments

Comments
 (0)