SyncHooks.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const HookTester = require("./HookTester");
  7. const SyncHook = require("../SyncHook");
  8. const SyncBailHook = require("../SyncBailHook");
  9. const SyncWaterfallHook = require("../SyncWaterfallHook");
  10. const SyncLoopHook = require("../SyncLoopHook");
  11. describe("SyncHook", () => {
  12. it("should have to correct behavior", async () => {
  13. const tester = new HookTester((args) => new SyncHook(args));
  14. const result = await tester.run(true);
  15. expect(result).toMatchSnapshot();
  16. }, 15000)
  17. })
  18. describe("SyncBailHook", () => {
  19. it("should have to correct behavior", async () => {
  20. const tester = new HookTester((args) => new SyncBailHook(args));
  21. const result = await tester.run(true);
  22. expect(result).toMatchSnapshot();
  23. }, 15000)
  24. })
  25. describe("SyncWaterfallHook", () => {
  26. it("should have to correct behavior", async () => {
  27. const tester = new HookTester((args) => new SyncWaterfallHook(args));
  28. const result = await tester.run(true);
  29. expect(result).toMatchSnapshot();
  30. }, 15000)
  31. })
  32. describe("SyncLoopHook", () => {
  33. it("should have to correct behavior", async () => {
  34. const tester = new HookTester((args) => new SyncLoopHook(args));
  35. const result = await tester.runForLoop(true);
  36. expect(result).toMatchSnapshot();
  37. }, 15000)
  38. })