-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "Added only, but failing tests"
This reverts commit 5c68369.
- Loading branch information
1 parent
5c68369
commit e2cdac1
Showing
5 changed files
with
137 additions
and
35 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,18 @@ | ||
import { evalite } from "../../../index.js"; | ||
import { reportTrace } from "../../../traces.js"; | ||
import { Levenshtein } from "autoevals"; | ||
|
||
evalite("Also Not Run", { | ||
data: () => { | ||
return [ | ||
{ | ||
input: "abc", | ||
expected: "abcdef", | ||
}, | ||
]; | ||
}, | ||
task: async (input) => { | ||
return input + "def"; | ||
}, | ||
scorers: [Levenshtein], | ||
}); |
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,32 @@ | ||
import { Levenshtein } from "autoevals"; | ||
import { evalite } from "../../../index.js"; | ||
|
||
evalite.only("Only", { | ||
data: () => { | ||
return [ | ||
{ | ||
input: "abc", | ||
expected: "abcdef", | ||
}, | ||
]; | ||
}, | ||
task: async (input) => { | ||
return input + "def"; | ||
}, | ||
scorers: [Levenshtein], | ||
}); | ||
|
||
evalite("Not Run", { | ||
data: () => { | ||
return [ | ||
{ | ||
input: "abc", | ||
expected: "abcdef", | ||
}, | ||
]; | ||
}, | ||
task: async (input) => { | ||
return input + "def"; | ||
}, | ||
scorers: [Levenshtein], | ||
}); |
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,26 @@ | ||
import { getJsonDbEvals } from "@evalite/core"; | ||
import { assert, expect, it } from "vitest"; | ||
import { runVitest } from "../command.js"; | ||
import { captureStdout, loadFixture } from "./test-utils.js"; | ||
|
||
it.only("Should only run the targeted eval", async () => { | ||
using fixture = loadFixture("only"); | ||
|
||
const captured = captureStdout(); | ||
|
||
await runVitest({ | ||
cwd: fixture.dir, | ||
path: undefined, | ||
testOutputWritable: captured.writable, | ||
}); | ||
|
||
console.log(captured.getOutput()); | ||
|
||
const evals = await getJsonDbEvals({ | ||
dbLocation: fixture.jsonDbLocation, | ||
}); | ||
|
||
expect(evals["Only"]).toBeDefined(); | ||
expect(evals["Not Run"]).toBeUndefined(); | ||
expect(evals["Also Not Run"]).toBeUndefined(); | ||
}); |