Skip to content

Commit

Permalink
test: sourcemap test add js source file
Browse files Browse the repository at this point in the history
  • Loading branch information
2239559319 committed Jan 16, 2024
1 parent 23d392d commit d01c834
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/fixtures/build/build-sourcemap/expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ export default (files: Record<string, string>) => {
readFileSync(join(__dirname, 'dist/cjs/utils/index.js.map'), 'utf-8'),
);
expect(map4.sources[0]).toEqual('../../../src/utils/index.ts');

// sourcefile js test
expect('esm/sourcejs.js.map' in files).toBe(true);
expect(files['esm/sourcejs.js']).toContain(
'//# sourceMappingURL=sourcejs.js.map',
);
expect('cjs/sourcejs.js.map' in files).toBe(true);
expect(files['cjs/sourcejs.js']).toContain(
'//# sourceMappingURL=sourcejs.js.map',
);
};
1 change: 1 addition & 0 deletions tests/fixtures/build/build-sourcemap/src/sourcejs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('source js test');

0 comments on commit d01c834

Please sign in to comment.