-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunit.ts
42 lines (37 loc) · 1.46 KB
/
unit.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { Step, UnkeyedStore, Json } from "@shanzhai/interfaces";
import { ParseJsonStep } from "@shanzhai/parse-json-step";
import { faviconsOptionsSourceStore } from "@shanzhai/favicons-options-source-store";
import { faviconsOptionsStore } from "@shanzhai/favicons-options-store";
import { UnkeyedStoreGetInput } from "@shanzhai/unkeyed-store-get-input";
import { UnkeyedStoreSetOutput } from "@shanzhai/unkeyed-store-set-output";
import parseFaviconsOptionsPlugin = require(".");
describe(`parse-favicons-options-plugin`, () => {
it(`is triggered by the expected stores`, () => {
expect(
parseFaviconsOptionsPlugin.triggers.parseFaviconsOptions.stores
).toEqual([faviconsOptionsSourceStore]);
});
it(`advertises the stores it will write to`, () => {
expect(
parseFaviconsOptionsPlugin.triggers.parseFaviconsOptions.writesToStores
).toEqual(jasmine.arrayWithExactContents([faviconsOptionsStore]));
});
describe(`when the favicons options are set`, () => {
let step: Step;
beforeAll(() => {
step =
parseFaviconsOptionsPlugin.triggers.parseFaviconsOptions.invalidated();
});
it(`parses the favicons options`, () => {
expect(step).toEqual(
new ParseJsonStep(
`Parse favicons options`,
new UnkeyedStoreGetInput(faviconsOptionsSourceStore),
new UnkeyedStoreSetOutput(
faviconsOptionsStore as unknown as UnkeyedStore<Json>
)
)
);
});
});
});