Skip to content

Commit

Permalink
fix: can not run script without addtional name
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Oct 4, 2024
1 parent df3ae9f commit 01bc3c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,5 @@ EXAMPLES
$ ai test ./named.fixture.yaml -l info
```
_See code: [src/commands/test/index.ts](https://github.com/offline-ai/cli-plugin-cmd-test.js/blob/v0.1.21/src/commands/test/index.ts)_
_See code: [src/commands/test/index.ts](https://github.com/offline-ai/cli-plugin-cmd-test.js/blob/v0.1.22/src/commands/test/index.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion src/lib/test-fixture-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export async function testFixtureFile(fixtureFilepath: string, userConfig: any)
} else {
// thisCmd.error('missing script to run! the script option should be in the fixture file: ' + script)
const fixtureFileBaseName = path.basename(fixtureFilepath, getMultiLevelExtname(fixtureFilepath, 2))
const scriptInfos = await AIScriptEx.getMatchedScriptInfos('/^'+ fixtureFileBaseName + '[.]/', {searchPaths: userConfig.agentDirs})
const scriptInfos = await AIScriptEx.getMatchedScriptInfos('/^'+ fixtureFileBaseName + '([.]|$)/', {searchPaths: userConfig.agentDirs})
const keys = Object.keys(scriptInfos)
const onlyIndex = keys.findIndex(id => scriptInfos[id].data.test?.only)
if (onlyIndex >= 0) {
Expand Down

0 comments on commit 01bc3c6

Please sign in to comment.