|
const baseDir = group.configFilePath ? path.dirname(group.configFilePath) : process.cwd(); |
|
const testFilesForGroup = collectTestFiles(group.files, baseDir) |
There is an assumption, in the code above, that tests are contained in the same directory as the configs. That is not the case for my project, which has this file structure:
configs
├── foo.js
└── bar.js
tests
├── foo
└── bar
web-test-runner.config.js
This is the configuration in web-test-runner.config.js
export default {
// ...base config
groups: [
{
name: 'foo',
files: 'test/foo/*.spec.js'
configFilePath: 'configs/foo.js'
},
{
name: 'bar',
files: 'test/bar/*spec.js'
configFilePath: 'configs/foo.js'
}
]
}
Because I am defining the files glob in web-test-runner.config.js, I would expect it to be relative to that file (or cwd), rather than relative to the configFilePath file.
web/packages/test-runner-core/src/runner/createSessionGroups.ts
Lines 68 to 69 in 9942e84
There is an assumption, in the code above, that tests are contained in the same directory as the configs. That is not the case for my project, which has this file structure:
This is the configuration in
web-test-runner.config.jsBecause I am defining the files glob in
web-test-runner.config.js, I would expect it to be relative to that file (orcwd), rather than relative to theconfigFilePathfile.