-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support importing package with ts export (#12)
- Loading branch information
1 parent
9cae68a
commit c63ab45
Showing
7 changed files
with
39 additions
and
5 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
tests/fixtures/node_modules/package-typescript-export/index.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
tests/fixtures/node_modules/package-typescript-export/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
import { testSuite, expect } from 'manten'; | ||
import type { NodeApis } from '../../utils/tsx'; | ||
|
||
export default testSuite(async ({ describe }, node: NodeApis) => { | ||
describe('Dependencies', ({ describe }) => { | ||
describe('TypeScript dependency', ({ test }) => { | ||
const output = '{"default":"ts default export","namedExport":"ts named export"}'; | ||
|
||
test('Import', async () => { | ||
const nodeProcess = await node.import('package-module/ts.ts'); | ||
expect(nodeProcess.stdout).toBe(output); | ||
expect(nodeProcess.stderr).toBe(''); | ||
}); | ||
|
||
test('Import', async () => { | ||
const nodeProcess = await node.import('package-typescript-export'); | ||
expect(nodeProcess.stdout).toBe(output); | ||
expect(nodeProcess.stderr).toBe(''); | ||
}); | ||
}); | ||
}); | ||
}); |
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