@universal-packages/workflows-jest 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +15 -5
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
const globals_1 = require("@jest/globals");
|
4
7
|
const sub_process_1 = require("@universal-packages/sub-process");
|
5
8
|
const workflows_1 = require("@universal-packages/workflows");
|
9
|
+
const events_1 = __importDefault(require("events"));
|
6
10
|
require("./globals");
|
7
11
|
const WORKFLOWS_JEST = {
|
8
12
|
mocked: false,
|
@@ -33,12 +37,18 @@ global.workflowsJest = {
|
|
33
37
|
},
|
34
38
|
mockRuns: () => {
|
35
39
|
WORKFLOWS_JEST.mocked = true;
|
40
|
+
class MockedWorkflow extends events_1.default {
|
41
|
+
constructor(name, options) {
|
42
|
+
super();
|
43
|
+
this.name = name;
|
44
|
+
this.options = options;
|
45
|
+
}
|
46
|
+
run() {
|
47
|
+
WORKFLOWS_JEST.ranMockedWorkflows.push({ name: this.name, options: this.options });
|
48
|
+
}
|
49
|
+
}
|
36
50
|
workflows_1.Workflow.buildFrom = (name, options) => {
|
37
|
-
return
|
38
|
-
run: () => {
|
39
|
-
WORKFLOWS_JEST.ranMockedWorkflows.push({ name, options });
|
40
|
-
}
|
41
|
-
};
|
51
|
+
return new MockedWorkflow(name, options);
|
42
52
|
};
|
43
53
|
}
|
44
54
|
};
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,2CAAsC;AACtC,iEAA4D;AAC5D,6DAAkF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;aAAM;YACL,OAAO;gBACL,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,QAAQ,+CAA+C,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,kBAAkB;gBACxI,IAAI;aACL,CAAA;SACF;KACF;AACH,CAAC;AAED,gBAAM,CAAC,MAAM,CAAC;IACZ,sBAAsB;IACtB,qBAAqB;IACrB,kCAAkC;CACnC,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@universal-packages/workflows-jest",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.2",
|
4
4
|
"description": "Jest matchers for universal workflows",
|
5
5
|
"author": "David De Anda <david@universal-packages.com> (https://github.com/universal-packages)",
|
6
6
|
"license": "MIT",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"update-dependents": "umaintenance update-dependents"
|
17
17
|
},
|
18
18
|
"peerDependencies": {
|
19
|
-
"@universal-packages/workflows": "^1.
|
19
|
+
"@universal-packages/workflows": "^1.7.0"
|
20
20
|
},
|
21
21
|
"devDependencies": {
|
22
22
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|