aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tapable/lib/__tests__/SyncHooks.js
blob: a5d04b4ec864302b9fef1836ba5dccf2a879f71a (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";

const HookTester = require("./HookTester");
const SyncHook = require("../SyncHook");
const SyncBailHook = require("../SyncBailHook");
const SyncWaterfallHook = require("../SyncWaterfallHook");
const SyncLoopHook = require("../SyncLoopHook");

describe("SyncHook", () => {
	it(
		"should have to correct behavior",
		async () => {
			const tester = new HookTester(args => new SyncHook(args));

			const result = await tester.run(true);

			expect(result).toMatchSnapshot();
		},
		15000
	);
});

describe("SyncBailHook", () => {
	it(
		"should have to correct behavior",
		async () => {
			const tester = new HookTester(args => new SyncBailHook(args));

			const result = await tester.run(true);

			expect(result).toMatchSnapshot();
		},
		15000
	);
});

describe("SyncWaterfallHook", () => {
	it(
		"should have to correct behavior",
		async () => {
			const tester = new HookTester(args => new SyncWaterfallHook(args));

			const result = await tester.run(true);

			expect(result).toMatchSnapshot();
		},
		15000
	);
});

describe("SyncLoopHook", () => {
	it(
		"should have to correct behavior",
		async () => {
			const tester = new HookTester(args => new SyncLoopHook(args));

			const result = await tester.runForLoop(true);

			expect(result).toMatchSnapshot();
		},
		15000
	);
});