-
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.
Merge pull request #1 from mattpocock/matt/only
Matt/only
- Loading branch information
Showing
11 changed files
with
312 additions
and
39 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,2 @@ | ||
cp packages/evalite/readme.md readme.md | ||
git add readme.md |
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
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(); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.