Allow option to run template test on individual files
Also adds some basic documentation on using the bazel test target. Sample usage: bazel test //polygerrit-ui/app:template_test --test_output errors \ --test_arg=gr-list-view Change-Id: I013f4c4e8411b6f34afb31e9baae3bb30dea5ad4
This commit is contained in:
@@ -42,9 +42,21 @@ fs.readdir('./polygerrit-ui/temp/behaviors/', (err, data) => {
|
||||
});
|
||||
}
|
||||
|
||||
const mappings = JSON.parse(fs.readFileSync(
|
||||
let mappings = JSON.parse(fs.readFileSync(
|
||||
`./polygerrit-ui/temp/map.json`, 'utf-8'));
|
||||
|
||||
// If a particular file was passed by the user, don't test everything.
|
||||
const file = process.argv[2];
|
||||
if (file) {
|
||||
const mappingSpecificFile = {};
|
||||
for (key of Object.keys(mappings)) {
|
||||
if (key.includes(file)) {
|
||||
mappingSpecificFile[key] = mappings[key];
|
||||
}
|
||||
}
|
||||
mappings = mappingSpecificFile;
|
||||
}
|
||||
|
||||
externs.push({
|
||||
path: 'custom-externs.js',
|
||||
src: '/** @externs */' +
|
||||
|
||||
Reference in New Issue
Block a user