This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
1 parent
32b4d86
commit 54e4e40
Showing
5 changed files
with
24 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const base64Module = (code) => `data:text/javascript;base64,${Buffer.from(code).toString('base64')}`; | ||
const dataUrl = base64Module('console.log(123)'); | ||
import(dataUrl); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { testSuite, expect } from 'manten'; | ||
import type { NodeApis } from '../utils/node-with-loader'; | ||
|
||
export default testSuite(async ({ describe }, node: NodeApis) => { | ||
describe('data', async ({ test }) => { | ||
const importPath = './lib/data/index.js'; | ||
|
||
test('Loads text/javascript data URLs', async () => { | ||
const nodeProcess = await node.load(importPath); | ||
|
||
expect(nodeProcess.exitCode).toBe(0); | ||
expect(nodeProcess.stdout).toMatch('123'); | ||
}); | ||
}); | ||
}); |