Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
test: Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoreis committed Oct 7, 2022
1 parent 90ad823 commit d62cb57
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"importMap": "./import-map.json",

"tasks": {
"test": "deno test -A"
},

"compilerOptions": {
"jsx": "preserve"
}
}
1 change: 1 addition & 0 deletions fixture/mod1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './mod2.ts'
3 changes: 3 additions & 0 deletions fixture/mod2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { inverse } from 'https://deno.land/std@0.158.0/fmt/colors.ts'

console.log(inverse('Hello!'))
5 changes: 5 additions & 0 deletions import-map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"imports": {
"fixture": "./fixture/mod1.ts"
}
}
9 changes: 9 additions & 0 deletions test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { importModule, importString } from './mod.ts'

Deno.test('importModule', async () => {
await importModule('fixture', { force: true })
})

Deno.test('importString', async () => {
console.log(await importString('export const foo = "bar"'))
})

0 comments on commit d62cb57

Please sign in to comment.