Skip to content

Commit db77f66

Browse files
committed
jest marbles
1 parent cdc5150 commit db77f66

File tree

4 files changed

+3410
-117
lines changed

4 files changed

+3410
-117
lines changed

jest.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
"roots": [
3+
"<rootDir>/src"
4+
],
5+
"transform": {
6+
"^.+\\.tsx?$": "ts-jest"
7+
},
8+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
9+
"moduleFileExtensions": [
10+
"ts",
11+
"tsx",
12+
"js",
13+
"jsx",
14+
"json",
15+
"node"
16+
],
17+
}

main.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { marbles } from "rxjs-marbles/mocha";
2+
import { map } from "rxjs/operators";
3+
4+
describe("rxjs-marbles", () => {
5+
6+
it("should support marble tests", marbles(m => {
7+
8+
const source = m.hot("--^-a-b-c-|");
9+
const subs = "^-------!";
10+
const expected = "--b-c-d-|";
11+
12+
const destination = source.pipe(
13+
map(value => String.fromCharCode(value.charCodeAt(0) + 1))
14+
);
15+
m.expect(destination).toBeObservable(expected);
16+
m.expect(source).toHaveSubscriptions(subs);
17+
}));
18+
});

0 commit comments

Comments
 (0)