Skip to content

Commit 01bc3c6

Browse files
committed
fix: can not run script without addtional name
1 parent df3ae9f commit 01bc3c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,5 @@ EXAMPLES
220220
$ ai test ./named.fixture.yaml -l info
221221
```
222222
223-
_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)_
223+
_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)_
224224
<!-- commandsstop -->

src/lib/test-fixture-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export async function testFixtureFile(fixtureFilepath: string, userConfig: any)
144144
} else {
145145
// thisCmd.error('missing script to run! the script option should be in the fixture file: ' + script)
146146
const fixtureFileBaseName = path.basename(fixtureFilepath, getMultiLevelExtname(fixtureFilepath, 2))
147-
const scriptInfos = await AIScriptEx.getMatchedScriptInfos('/^'+ fixtureFileBaseName + '[.]/', {searchPaths: userConfig.agentDirs})
147+
const scriptInfos = await AIScriptEx.getMatchedScriptInfos('/^'+ fixtureFileBaseName + '([.]|$)/', {searchPaths: userConfig.agentDirs})
148148
const keys = Object.keys(scriptInfos)
149149
const onlyIndex = keys.findIndex(id => scriptInfos[id].data.test?.only)
150150
if (onlyIndex >= 0) {

0 commit comments

Comments
 (0)