Skip to content

Commit

Permalink
test: use local server instead of esm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jan 17, 2024
1 parent 74cce1f commit ab91ffc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default antfu(
'test/core/src/self',
'test/workspaces/results.json',
'test/reporters/fixtures/with-syntax-error.test.js',
'test/network-imports/public/slash@3.0.0.js',
'examples/**/mockServiceWorker.js',
],
},
Expand Down
5 changes: 5 additions & 0 deletions test/network-imports/public/slash@3.0.0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion test/network-imports/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { expect, test } from 'vitest'

// @ts-expect-error network imports
import slash from 'https://esm.sh/slash@5.1.0'
import slash from 'http://localhost:9602/slash@3.0.0.js'

// test without local server
// import slash from 'https://esm.sh/slash@3.0.0'

test('network imports', () => {
expect(slash('foo\\bar')).toBe('foo/bar')
Expand Down
2 changes: 2 additions & 0 deletions test/network-imports/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export default defineConfig({
execArgv: ['--experimental-network-imports'],
},
},
// let vite serve public/slash@3.0.0.js
api: 9602,
},
})

0 comments on commit ab91ffc

Please sign in to comment.