()
| 1012 | } |
| 1013 | |
| 1014 | buildQueue() { |
| 1015 | const queue = []; |
| 1016 | let argFilename; |
| 1017 | let argVariant; |
| 1018 | if (process.argv[2]) { |
| 1019 | ([argFilename, argVariant = ''] = process.argv[2].split('?')); |
| 1020 | } |
| 1021 | for (const spec of this.specs) { |
| 1022 | if (argFilename) { |
| 1023 | if (spec.filename === argFilename && (!argVariant || spec.variant.substring(1) === argVariant)) { |
| 1024 | queue.push(spec); |
| 1025 | } |
| 1026 | continue; |
| 1027 | } |
| 1028 | |
| 1029 | if (spec.skipReasons.length > 0) { |
| 1030 | this.skip(spec, spec.skipReasons); |
| 1031 | continue; |
| 1032 | } |
| 1033 | |
| 1034 | const lackingSupport = buildRequirements.isLacking(spec.requires); |
| 1035 | if (lackingSupport) { |
| 1036 | this.skip(spec, [ `requires ${lackingSupport}` ]); |
| 1037 | continue; |
| 1038 | } |
| 1039 | |
| 1040 | queue.push(spec); |
| 1041 | } |
| 1042 | |
| 1043 | // If the tests are run as `node test/wpt/test-something.js subset.any.js`, |
| 1044 | // only `subset.any.js` (all variants) will be run by the runner. |
| 1045 | // If the tests are run as `node test/wpt/test-something.js 'subset.any.js?1-10'`, |
| 1046 | // only the `?1-10` variant of `subset.any.js` will be run by the runner. |
| 1047 | if (argFilename && queue.length === 0) { |
| 1048 | throw new Error(`${process.argv[2]} not found!`); |
| 1049 | } |
| 1050 | |
| 1051 | return queue; |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | module.exports = { |
no test coverage detected