Skip to content

Commit 7b7d493

Browse files
authored
[FEA] Add AsyncIterable switchMap (#340)
* feat(asynciterable): add AsyncIterable switchMap operator * fix lint and run prettier on all files * fix typo * refactor SwitchMapAsyncIterable into generic FlattenConcurrentAsyncIterable * update typescript, jest, related dependencies * feat(flatmap.ts): make flatMap enumerate inner sequences in parallel BREAKING CHANGE: flatMap enumerates inner sequences in parallel fix #244 * feat(flat.ts): make flat enumerate inner sequences in parallel BREAKING CHANGE: flat enumerates inner sequences in parallel * feat(concatmap.ts): add concatMap implementation
1 parent 1807093 commit 7b7d493

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+838
-576
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
},
3535
"args": [
3636
"--verbose",
37-
"-runInBand",
3837
"--no-cache",
38+
"--runInBand",
3939
"-c", "jestconfigs/jest.${input:TEST_TARGET}.config.js",
4040
"${input:TEST_FILE}"
4141
]

gulp/argv.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616
// under the License.
1717

1818
const argv = require(`command-line-args`)([
19-
{ name: `all`, type: Boolean },
20-
{ name: 'verbose', alias: 'v', type: Boolean },
21-
{ name: `target`, type: String, defaultValue: `` },
22-
{ name: `module`, type: String, defaultValue: `` },
23-
{ name: `coverage`, type: Boolean, defaultValue: false },
24-
{ name: `targets`, alias: `t`, type: String, multiple: true, defaultValue: [] },
25-
{ name: `modules`, alias: `m`, type: String, multiple: true, defaultValue: [] },
19+
{ name: `all`, type: Boolean },
20+
{ name: 'verbose', alias: 'v', type: Boolean },
21+
{ name: `target`, type: String, defaultValue: `` },
22+
{ name: `module`, type: String, defaultValue: `` },
23+
{ name: `coverage`, type: Boolean, defaultValue: false },
24+
{ name: `tests`, type: String, multiple: true, defaultValue: [`spec/*`] },
25+
{ name: `targets`, alias: `t`, type: String, multiple: true, defaultValue: [] },
26+
{ name: `modules`, alias: `m`, type: String, multiple: true, defaultValue: [] },
2627
], { partial: true });
2728

2829
const { targets, modules } = argv;
2930

3031
if (argv.target === `src`) {
31-
argv.target && !targets.length && targets.push(argv.target);
32+
argv.target && !targets.length && targets.push(argv.target);
3233
} else {
33-
argv.target && !targets.length && targets.push(argv.target);
34-
argv.module && !modules.length && modules.push(argv.module);
35-
(argv.all || !targets.length) && targets.push(`all`);
36-
(argv.all || !modules.length) && modules.push(`all`);
34+
argv.target && !targets.length && targets.push(argv.target);
35+
argv.module && !modules.length && modules.push(argv.module);
36+
(argv.all || !targets.length) && targets.push(`all`);
37+
(argv.all || !modules.length) && modules.push(`all`);
3738
}
3839

3940
module.exports = { argv, targets, modules };

gulp/test-task.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,31 @@ if (targetAndModuleCombinations.length > 1) {
3434

3535
const jest = path.join(path.parse(require.resolve(`jest`)).dir, `../bin/jest.js`);
3636
const testOptions = {
37-
stdio: [`ignore`, `inherit`, `inherit`],
38-
env: {
39-
...process.env,
40-
// hide fs.promises/stream[Symbol.asyncIterator] warnings
41-
NODE_NO_WARNINGS: `1`,
42-
TS_JEST_DISABLE_VER_CHECKER: true
43-
},
37+
stdio: [`ignore`, `inherit`, `inherit`],
38+
env: {
39+
...process.env,
40+
// hide fs.promises/stream[Symbol.asyncIterator] warnings
41+
NODE_NO_WARNINGS: `1`,
42+
TS_JEST_DISABLE_VER_CHECKER: true
43+
},
4444
};
4545

4646
const testTask = ((cache, execArgv, testOptions) => memoizeTask(cache, function test(target, format) {
47-
const args = [...execArgv];
48-
const opts = { ...testOptions };
49-
if (argv.coverage) {
50-
args.push(`-c`, `jest.coverage.config.js`, `--coverage`);
51-
} else {
52-
const cfgname = [target, format].filter(Boolean).join('.');
53-
args.push(`-c`, `jestconfigs/jest.${cfgname}.config.js`, `spec/*`);
54-
}
55-
opts.env = { ...opts.env,
56-
TEST_DOM_STREAMS: (target ==='src' || format === 'umd').toString(),
57-
TEST_NODE_STREAMS: (target ==='src' || format !== 'umd').toString(),
58-
};
59-
return asyncDone(() => child_process.spawn(`node`, args, opts));
47+
const args = [...execArgv];
48+
const opts = { ...testOptions };
49+
if (argv.coverage) {
50+
args.push(`-c`, `jest.coverage.config.js`, `--coverage`);
51+
} else {
52+
const cfgname = [target, format].filter(Boolean).join('.');
53+
// args.push(`--verbose`, `--no-cache`, `-i`);
54+
args.push(`-c`, `jestconfigs/jest.${cfgname}.config.js`, ...argv.tests);
55+
}
56+
opts.env = {
57+
...opts.env,
58+
TEST_DOM_STREAMS: (target === 'src' || format === 'umd').toString(),
59+
TEST_NODE_STREAMS: (target === 'src' || format !== 'umd').toString(),
60+
};
61+
return asyncDone(() => child_process.spawn(`node`, args, opts));
6062
}))({}, [jest, ...jestArgv], testOptions);
6163

6264
module.exports = testTask;

0 commit comments

Comments
 (0)