Skip to content

Commit d69604a

Browse files
committed
Updated rust-toolchain
1 parent 8a936df commit d69604a

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

examples/src/custom_resolver/custom_resolver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { executeExample } from '../../test-utils/run_test.ts'
66
Deno.test("custom_resolver", async () => {
77
const result = await executeExample("custom_resolver")
88
assertEquals(result, [
9-
`Custom Resolver Has Run For Path "${Paths["~/examples/"]("test-utils")}"`,
9+
`Custom Resolver Has Run For Path "${Paths["~"]}"`,
1010
`Custom Resolver Has Run For Path "${Paths["~/examples/"]('js', 'modules', 'index.js')}"`,
1111
`Custom Resolver Has Run For Path "${Paths["~/examples/"]('js', 'modules', 'index.js')}"`,
1212
`Custom Resolver Has Run For Path "${Paths["~/examples/"]('js', 'modules', 'a.js')}"`,

examples/test-utils/run_test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
export async function executeExample(testName: string): Promise<string> {
2-
const scriptPath = new URL(import.meta.url).pathname;
3-
const scriptDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
1+
import { Paths } from './paths.ts'
42

5-
const command = new Deno.Command("cargo", {
6-
args: ["run", "-p", "ion_examples", "--", testName],
3+
const binName = Deno.build.os === "windows" ? "ion_examples.exe" : "ion_examples"
4+
5+
export async function executeExample(testName: string, args: string[] = [], env: Record<string, string> = {}): Promise<string> {
6+
const command = new Deno.Command(Paths["~/"]("target", "debug", binName), {
7+
args: [testName, ...args],
78
stdout: "piped",
89
stderr: "piped",
9-
cwd: scriptDir,
10+
cwd: Paths["~"],
11+
env: {
12+
...Deno.env.toObject(),
13+
...env
14+
}
1015
});
1116

1217
const { code, stdout, stderr } = await command.output();

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.90.0
1+
1.92.0

0 commit comments

Comments
 (0)