Skip to content

Commit

Permalink
feat: use wildcard export in tests
Browse files Browse the repository at this point in the history
Additionally, to make sure that not all files in the tree are getting
included automatically (which would have invalidated the wildcard export
tests), an unreachable file that should not appear in the list of
dependencies was added to the relevant examples.
  • Loading branch information
sorccu committed Dec 13, 2024
1 parent e334082 commit 7939686
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dep6' // wildcard export
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const value = 'Hello World'
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import dep2 from './dep2'
import { dep3 } from './dep3'
export { value } from './dep1'
export { dep4 } from './dep4.mjs'
export { value as otherValue } from './dep5.mjs'

/* eslint-disable no-console */
console.log('Received ', dep2, dep3)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dep6' // wildcard export
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const value = 'Hello World'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dep2 from './dep2'
import { dep3 } from './dep3'
export { value } from './dep1'
export { value as otherValue } from './dep5'

/* eslint-disable no-console */
console.log('Received ', dep2, dep3)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is intentionally not reachable from the entrypoint and should
// not appear in the list of dependencies.

export const value = 'Hello World'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dep6' // wildcard export
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const value = 'Hello World'
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as moduleImport from './module'
import * as modulePackage from './module-package'
import { ExternalFirstPage } from './pages/external.first.page.js'
import { ExternalSecondPage } from './pages/external.second.page'
export { value } from './dep5' // named export

export function doMath (num: number): number {
return add(num, subtract(10, 7))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is intentionally not reachable from the entrypoint and should
// not appear in the list of dependencies.

export const value = 'Hello World'
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ describe('dependency-parser - parser()', () => {
toAbsolutePath('dep2.ts'),
toAbsolutePath('dep3.ts'),
toAbsolutePath('dep4.js'),
toAbsolutePath('dep5.ts'),
toAbsolutePath('dep6.ts'),
toAbsolutePath('module-package', 'main.js'),
toAbsolutePath('module-package', 'package.json'),
toAbsolutePath('module', 'index.ts'),
Expand All @@ -135,6 +137,8 @@ describe('dependency-parser - parser()', () => {
toAbsolutePath('dep1.js'),
toAbsolutePath('dep2.js'),
toAbsolutePath('dep3.js'),
toAbsolutePath('dep5.js'),
toAbsolutePath('dep6.js'),
])
})

Expand All @@ -149,6 +153,8 @@ describe('dependency-parser - parser()', () => {
toAbsolutePath('dep2.mjs'),
toAbsolutePath('dep3.mjs'),
toAbsolutePath('dep4.mjs'),
toAbsolutePath('dep5.mjs'),
toAbsolutePath('dep6.mjs'),
])
})

Expand Down

0 comments on commit 7939686

Please sign in to comment.