rewriteDefault.spec.ts — vue Source File
Architecture documentation for rewriteDefault.spec.ts, a typescript file in the vue codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 48df46f9_8487_25b2_3525_f63eee26de01["rewriteDefault.spec.ts"] 2d0b7943_2ac1_bdbf_a8a4_e0377d6f068a["index.ts"] 48df46f9_8487_25b2_3525_f63eee26de01 --> 2d0b7943_2ac1_bdbf_a8a4_e0377d6f068a style 48df46f9_8487_25b2_3525_f63eee26de01 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { rewriteDefault } from '../src'
describe('compiler sfc: rewriteDefault', () => {
test('without export default', () => {
expect(rewriteDefault(`export a = {}`, 'script')).toMatchInlineSnapshot(`
"export a = {}
const script = {}"
`)
})
test('rewrite export default', () => {
expect(
rewriteDefault(`export default {}`, 'script')
).toMatchInlineSnapshot(`"const script = {}"`)
})
test('rewrite export named default', () => {
expect(
rewriteDefault(
`const a = 1 \n export { a as b, a as default, a as c}`,
'script'
)
).toMatchInlineSnapshot(`
"const a = 1
export { a as b, a as c}
const script = a"
`)
expect(
rewriteDefault(
`const a = 1 \n export { a as b, a as default , a as c}`,
'script'
)
).toMatchInlineSnapshot(`
"const a = 1
export { a as b, a as c}
const script = a"
`)
})
test('w/ comments', async () => {
expect(rewriteDefault(`// export default\nexport default {}`, 'script'))
.toMatchInlineSnapshot(`
"// export default
const script = {}"
`)
})
test('export named default multiline', () => {
expect(
rewriteDefault(`let App = {}\n export {\nApp as default\n}`, '_sfc_main')
).toMatchInlineSnapshot(`
"let App = {}
export {
}
const _sfc_main = App"
`)
})
// ... (252 more lines)
Domain
Dependencies
Source
Frequently Asked Questions
What does rewriteDefault.spec.ts do?
rewriteDefault.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain.
What does rewriteDefault.spec.ts depend on?
rewriteDefault.spec.ts imports 1 module(s): index.ts.
Where is rewriteDefault.spec.ts in the architecture?
rewriteDefault.spec.ts is located at packages/compiler-sfc/test/rewriteDefault.spec.ts (domain: VueCore, directory: packages/compiler-sfc/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free