-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from hasura/lyndon/external_dependencies_test
Adding (currently ignored) test to verify behaviour of external dependency usage
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
.PHONY: help | ||
help: | ||
@echo Targets: | ||
@cat Makefile | grep '^[a-zA-Z]' | sed 's/^/ * /; s/://' | ||
|
||
test: | ||
deno test -A src/test | ||
|
||
test-and-watch: | ||
deno test -A --watch src/test | ||
|
||
serve: | ||
@echo Note, this requires a config argument - Run the command directly. | ||
deno run -A --watch --check src/mod.ts serve |
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,9 @@ | ||
|
||
import * as base64 from "https://denopkg.com/chiefbiiko/[email protected]/mod.ts"; | ||
import * as emojify from "npm:[email protected]"; | ||
|
||
export function test_deps(s: string): string { | ||
const b64 = base64.fromUint8Array(new TextEncoder().encode(s)); | ||
const emo = emojify.emojify(":t-rex: :heart: NPM"); | ||
return `${b64} ${emo}`; | ||
} |
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,29 @@ | ||
|
||
import * as test from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import * as path from "https://deno.land/[email protected]/path/mod.ts"; | ||
import * as infer from '../infer.ts'; | ||
|
||
// Skipped due to NPM dependency resolution not currently being supported. | ||
Deno.test({ | ||
name: "Inference", | ||
ignore: true, | ||
fn() { | ||
const program_path = path.fromFileUrl(import.meta.resolve('./data/external_dependencies.ts')); | ||
const vendor_path = path.fromFileUrl(import.meta.resolve('./vendor')); | ||
const program_results = infer.programInfo(program_path, vendor_path, false); | ||
|
||
test.assertEquals(program_results, { | ||
positions: { | ||
}, | ||
schema: { | ||
scalar_types: { | ||
}, | ||
object_types: {}, | ||
collections: [], | ||
functions: [], | ||
procedures: [ | ||
], | ||
} | ||
}); | ||
} | ||
}); |