-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import mod1 from './module1' | ||
import { mod2 } from './module2' | ||
|
||
export default { | ||
foo: 'foo', | ||
mod1, | ||
nest: { | ||
bar: 'bar', | ||
mod2: mod2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
module1: 'this is module1' | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/bundle-utils/test/generator/__snapshots__/js1.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`import > code 1`] = ` | ||
"const resource = { | ||
\\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})(), | ||
\\"nest\\": { | ||
\\"bar\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), | ||
} | ||
} | ||
export default resource" | ||
`; | ||
|
||
exports[`import > map 1`] = ` | ||
{ | ||
"mappings": "", | ||
"names": [], | ||
"sources": [], | ||
"version": 3, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { readFile, validateSyntax } from '../utils' | ||
import { generate } from '../../src/js' | ||
|
||
test('import', async () => { | ||
const { source } = await readFile('./fixtures/codegen/import.js') | ||
const { code, map } = generate(source, { | ||
sourceMap: true, | ||
env: 'development' | ||
}) | ||
|
||
expect(code).toMatchSnapshot('code') | ||
expect(map).toMatchSnapshot('map') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters