not-node 6.5.27 → 6.5.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,10 +20,7 @@ module.exports = ({ expect }) => {
20
20
 
21
21
  describe("run", function () {
22
22
  it("path to fields is not defined", function () {
23
- const ctx = {
24
- findAll() {},
25
- extendByFrontValidators() {},
26
- };
23
+ const ctx = {};
27
24
  const param = {
28
25
  nModule: {
29
26
  module: {
@@ -31,10 +28,7 @@ module.exports = ({ expect }) => {
31
28
  },
32
29
  },
33
30
  };
34
- const res = notModuleRegistratorFields.prototype.run.call(
35
- ctx,
36
- param
37
- );
31
+ const res = notModuleRegistratorFields.run.call(ctx, param);
38
32
  expect(res).to.be.false;
39
33
  });
40
34
 
@@ -52,10 +46,7 @@ module.exports = ({ expect }) => {
52
46
  },
53
47
  },
54
48
  };
55
- const res = notModuleRegistratorFields.prototype.run.call(
56
- ctx,
57
- param
58
- );
49
+ const res = notModuleRegistratorFields.run.call(ctx, param);
59
50
  expect(res).to.be.true;
60
51
  });
61
52
  });
@@ -79,7 +70,7 @@ module.exports = ({ expect }) => {
79
70
  nModule: {},
80
71
  srcDir: logicsPath,
81
72
  };
82
- notModuleRegistratorFields.prototype.findAll.call(ctx, param);
73
+ notModuleRegistratorFields.findAll.call(ctx, param);
83
74
  result.sort();
84
75
  expect(result).to.be.deep.equal(list);
85
76
  });
@@ -108,7 +99,7 @@ module.exports = ({ expect }) => {
108
99
  },
109
100
  fromPath: libPath,
110
101
  };
111
- notModuleRegistratorFields.prototype.register.call(ctx, param);
102
+ notModuleRegistratorFields.register.call(ctx, param);
112
103
  });
113
104
 
114
105
  it("file is single field", (done) => {
@@ -133,7 +124,7 @@ module.exports = ({ expect }) => {
133
124
  "../testies/module/fields/single.js"
134
125
  ),
135
126
  };
136
- notModuleRegistratorFields.prototype.register.call(ctx, param);
127
+ notModuleRegistratorFields.register.call(ctx, param);
137
128
  });
138
129
  });
139
130
 
@@ -165,10 +156,7 @@ module.exports = ({ expect }) => {
165
156
  "../testies/module/fields/collection.js"
166
157
  )).FIELDS,
167
158
  };
168
- notModuleRegistratorFields.prototype.registerFields.call(
169
- ctx,
170
- param
171
- );
159
+ notModuleRegistratorFields.registerFields.call(ctx, param);
172
160
  });
173
161
  });
174
162
 
@@ -195,10 +183,7 @@ module.exports = ({ expect }) => {
195
183
  },
196
184
  },
197
185
  };
198
- notModuleRegistratorFields.prototype.registerField.call(
199
- ctx,
200
- param
201
- );
186
+ notModuleRegistratorFields.registerField.call(ctx, param);
202
187
  expect(Object.keys(FIELDS).includes("single")).to.be.true;
203
188
  });
204
189
  });
@@ -1,42 +1,38 @@
1
- const notModuleRegistratorLocales = require('../../src/manifest/registrator/locales');
1
+ const notModuleRegistratorLocales = require("../../src/manifest/registrator/locales");
2
2
 
3
- module.exports = ({
4
- expect
5
- }) => {
6
- describe('notModuleRegistratorLocales', () => {
7
- describe('getPath', () => {
8
- it('module paths(locales)', function() {
9
- const testPath = 'path_to_locales';
10
- const ctx = {
11
- module: {
12
- paths: {
13
- locales: testPath
14
- }
15
- }
16
- };
17
- const pathTo = notModuleRegistratorLocales.getPath(ctx);
18
- expect(pathTo).to.be.equal(testPath);
19
- });
20
- });
3
+ module.exports = ({ expect }) => {
4
+ describe("notModuleRegistratorLocales", () => {
5
+ describe("getPath", () => {
6
+ it("module paths(locales)", function () {
7
+ const testPath = "path_to_locales";
8
+ const ctx = {
9
+ module: {
10
+ paths: {
11
+ locales: testPath,
12
+ },
13
+ },
14
+ };
15
+ const pathTo = notModuleRegistratorLocales.getPath(ctx);
16
+ expect(pathTo).to.be.equal(testPath);
17
+ });
18
+ });
21
19
 
22
- describe('run', () => {
23
- it('path exists', function() {
24
- const testPath = 'path_to_locales';
25
- const nModule = {
26
- module: {
27
- paths: {
28
- locales: testPath
29
- }
30
- },
31
- getName(){
32
- return 'test'
33
- }
34
- };
35
- const ctx = {};
36
- const res = notModuleRegistratorLocales.prototype.run.call(ctx, {nModule});
37
- expect(res).to.be.true;
38
- });
20
+ describe("run", () => {
21
+ it("path exists", function () {
22
+ const testPath = "path_to_locales";
23
+ const nModule = {
24
+ module: {
25
+ paths: {
26
+ locales: testPath,
27
+ },
28
+ },
29
+ getName() {
30
+ return "test";
31
+ },
32
+ };
33
+ const res = notModuleRegistratorLocales.run({ nModule });
34
+ expect(res).to.be.true;
35
+ });
36
+ });
39
37
  });
40
-
41
- });
42
38
  };
@@ -1,196 +1,211 @@
1
- const path = require('path');
2
-
3
- const notModuleRegistratorLogics = require('../../src/manifest/registrator/logics');
4
-
5
- module.exports = ({
6
- expect
7
- }) => {
8
- describe('notModuleRegistratorLogics', () => {
9
-
10
- describe('getPath', () => {
11
- it('module paths(logics)', function() {
12
- const testPath = 'path_to_logics';
13
- const ctx = {
14
- module: {
15
- paths: {
16
- logics: testPath
17
- }
18
- }
19
- };
20
- const pathTo = notModuleRegistratorLogics.getPath(ctx);
21
- expect(pathTo).to.be.equal(testPath);
22
- });
23
- });
24
-
25
-
26
- describe('getName', () => {
27
- it('get logics name, thisLogicName is set', function() {
28
- const param = {
29
- logic: {
30
- thisLogicName: 'thisLogicName'
31
- },
32
- file: 'filename'
33
- };
34
- const name = notModuleRegistratorLogics.getName(param);
35
- expect(name).to.be.equal('thisLogicName');
36
- });
37
-
38
- it('get logics name, thisLogicName is not set', function() {
39
- const param = {
40
- logic: {},
41
- file: 'filename'
42
- };
43
- const name = notModuleRegistratorLogics.getName(param);
44
- expect(name).to.be.equal('filename');
45
- });
46
- });
47
-
48
- describe('run', () => {
49
- const logicsPath = path.join(__dirname, '../testies/module/logics');
50
- it('path to logics is not defined', function() {
51
- const ctx = {
52
- findAll(){}
53
- };
54
- const param = {
55
- nModule:{
56
- module:{ paths:{} }
57
- }
58
- };
59
- const res = notModuleRegistratorLogics.prototype.run.call(ctx, param);
60
- expect(res).to.be.false;
61
-
62
- });
63
-
64
- it('paths to logics is defined', function() {
65
- const ctx = {
66
- findAll(){}
67
- };
68
- const param = {
69
- nModule:{
70
- module:{ paths:{logics: 'path_to_logics'} }
71
- }
72
- };
73
- const res = notModuleRegistratorLogics.prototype.run.call(ctx, param);
74
- expect(res).to.be.true;
75
- });
76
- });
77
-
78
- describe('extend', function() {
79
- it('notApp exists', function() {
80
- const logic = {
81
- filename: 'filename'
82
- };
83
- const ctx = {};
84
- const param = {
85
- logic,
86
- logicName: '',
87
- fromPath: '',
88
- nModule: {
89
- appIsSet(){return true;},
90
- getApp(){
91
- return {
92
- getModel(){},
93
- getModelFile(){},
94
- getModelSchema(){},
95
- getLogic(){},
96
- getLogicFile(){},
97
- getModule(){},
98
- };
99
- }
100
- }
101
- };
102
- notModuleRegistratorLogics.prototype.extend.call(ctx, param);
103
-
104
- expect(typeof logic.getModel).to.be.equal('function');
105
- expect(typeof logic.getModelFile).to.be.equal('function');
106
- expect(typeof logic.getModelSchema).to.be.equal('function');
107
- expect(typeof logic.getLogic).to.be.equal('function');
108
- expect(typeof logic.getLogicFile).to.be.equal('function');
109
- expect(typeof logic.getModule).to.be.equal('function');
110
-
111
- expect(typeof logic.log.log).to.be.equal('function');
112
- expect(typeof logic.log.error).to.be.equal('function');
113
- expect(typeof logic.log.debug).to.be.equal('function');
114
-
115
- expect(logic).to.have.keys(['getThisModule', 'filename', 'log', 'getModel', 'getModelFile', 'getModelSchema', 'getLogic', 'getLogicFile', 'getModule']);
116
- expect(logic.getThisModule()).to.be.deep.equal(param.nModule);
117
- });
118
-
119
- it('notApp doesnt exists', function() {
120
- const logic = {
121
- filename: 'filename'
122
- };
123
- const ctx = {};
124
- const param = {
125
- logic,
126
- logicName: '',
127
- fromPath: '',
128
- nModule: {
129
- appIsSet(){return false;},
130
- getApp(){
131
- return {
132
- getModel(){},
133
- getModelFile(){},
134
- getModelSchema(){},
135
- getModule(){},
136
- };
137
- }
138
- }
139
- };
140
- notModuleRegistratorLogics.prototype.extend.call(ctx, param);
141
-
142
- expect(typeof logic.log.log).to.be.equal('function');
143
- expect(typeof logic.log.error).to.be.equal('function');
144
- expect(typeof logic.log.debug).to.be.equal('function');
145
-
146
- expect(logic).to.have.keys(['getThisModule', 'filename', 'log']);
147
- expect(logic.getThisModule()).to.be.deep.equal(param.nModule);
148
- });
1
+ const path = require("path");
2
+
3
+ const notModuleRegistratorLogics = require("../../src/manifest/registrator/logics");
4
+
5
+ module.exports = ({ expect }) => {
6
+ describe("notModuleRegistratorLogics", () => {
7
+ describe("getPath", () => {
8
+ it("module paths(logics)", function () {
9
+ const testPath = "path_to_logics";
10
+ const ctx = {
11
+ module: {
12
+ paths: {
13
+ logics: testPath,
14
+ },
15
+ },
16
+ };
17
+ const pathTo = notModuleRegistratorLogics.getPath(ctx);
18
+ expect(pathTo).to.be.equal(testPath);
19
+ });
20
+ });
21
+
22
+ describe("getName", () => {
23
+ it("get logics name, thisLogicName is set", function () {
24
+ const param = {
25
+ logic: {
26
+ thisLogicName: "thisLogicName",
27
+ },
28
+ file: "filename",
29
+ };
30
+ const name = notModuleRegistratorLogics.getName(param);
31
+ expect(name).to.be.equal("thisLogicName");
32
+ });
33
+
34
+ it("get logics name, thisLogicName is not set", function () {
35
+ const param = {
36
+ logic: {},
37
+ file: "filename",
38
+ };
39
+ const name = notModuleRegistratorLogics.getName(param);
40
+ expect(name).to.be.equal("filename");
41
+ });
42
+ });
43
+
44
+ describe("run", () => {
45
+ const logicsPath = path.join(__dirname, "../testies/module/logics");
46
+ it("path to logics is not defined", function () {
47
+ const ctx = {
48
+ findAll() {},
49
+ };
50
+ const param = {
51
+ nModule: {
52
+ module: { paths: {} },
53
+ },
54
+ };
55
+ const res = notModuleRegistratorLogics.run.call(ctx, param);
56
+ expect(res).to.be.false;
57
+ });
58
+
59
+ it("paths to logics is defined", function () {
60
+ const ctx = {
61
+ findAll() {},
62
+ };
63
+ const param = {
64
+ nModule: {
65
+ module: { paths: { logics: "path_to_logics" } },
66
+ },
67
+ };
68
+ const res = notModuleRegistratorLogics.run.call(ctx, param);
69
+ expect(res).to.be.true;
70
+ });
71
+ });
72
+
73
+ describe("extend", function () {
74
+ it("notApp exists", function () {
75
+ const logic = {
76
+ filename: "filename",
77
+ };
78
+ const ctx = {};
79
+ const param = {
80
+ logic,
81
+ logicName: "",
82
+ fromPath: "",
83
+ nModule: {
84
+ appIsSet() {
85
+ return true;
86
+ },
87
+ getApp() {
88
+ return {
89
+ getModel() {},
90
+ getModelFile() {},
91
+ getModelSchema() {},
92
+ getLogic() {},
93
+ getLogicFile() {},
94
+ getModule() {},
95
+ };
96
+ },
97
+ },
98
+ };
99
+ notModuleRegistratorLogics.extend.call(ctx, param);
100
+
101
+ expect(typeof logic.getModel).to.be.equal("function");
102
+ expect(typeof logic.getModelFile).to.be.equal("function");
103
+ expect(typeof logic.getModelSchema).to.be.equal("function");
104
+ expect(typeof logic.getLogic).to.be.equal("function");
105
+ expect(typeof logic.getLogicFile).to.be.equal("function");
106
+ expect(typeof logic.getModule).to.be.equal("function");
107
+
108
+ expect(typeof logic.log.log).to.be.equal("function");
109
+ expect(typeof logic.log.error).to.be.equal("function");
110
+ expect(typeof logic.log.debug).to.be.equal("function");
111
+
112
+ expect(logic).to.have.keys([
113
+ "getThisModule",
114
+ "filename",
115
+ "log",
116
+ "getModel",
117
+ "getModelFile",
118
+ "getModelSchema",
119
+ "getLogic",
120
+ "getLogicFile",
121
+ "getModule",
122
+ ]);
123
+ expect(logic.getThisModule()).to.be.deep.equal(param.nModule);
124
+ });
125
+
126
+ it("notApp doesnt exists", function () {
127
+ const logic = {
128
+ filename: "filename",
129
+ };
130
+ const ctx = {};
131
+ const param = {
132
+ logic,
133
+ logicName: "",
134
+ fromPath: "",
135
+ nModule: {
136
+ appIsSet() {
137
+ return false;
138
+ },
139
+ getApp() {
140
+ return {
141
+ getModel() {},
142
+ getModelFile() {},
143
+ getModelSchema() {},
144
+ getModule() {},
145
+ };
146
+ },
147
+ },
148
+ };
149
+ notModuleRegistratorLogics.extend.call(ctx, param);
150
+
151
+ expect(typeof logic.log.log).to.be.equal("function");
152
+ expect(typeof logic.log.error).to.be.equal("function");
153
+ expect(typeof logic.log.debug).to.be.equal("function");
154
+
155
+ expect(logic).to.have.keys([
156
+ "getThisModule",
157
+ "filename",
158
+ "log",
159
+ ]);
160
+ expect(logic.getThisModule()).to.be.deep.equal(param.nModule);
161
+ });
162
+ });
163
+
164
+ describe("register", () => {
165
+ const logicsPath = path.join(
166
+ __dirname,
167
+ "../testies/module/logics/one.js"
168
+ );
169
+ it("file exists", function (done) {
170
+ const ctx = {
171
+ extend() {},
172
+ };
173
+ const param = {
174
+ nModule: {
175
+ module: { paths: {} },
176
+ setLogic(logicName, logic) {
177
+ expect(logicName).to.be.equal("One");
178
+ done();
179
+ },
180
+ },
181
+ fromPath: logicsPath,
182
+ file: "one.js",
183
+ };
184
+ notModuleRegistratorLogics.register.call(ctx, param);
185
+ expect(res).to.be.false;
186
+ });
187
+ });
188
+
189
+ describe("findAll", () => {
190
+ const logicsPath = path.join(__dirname, "../testies/module/logics");
191
+ it("path exists", function () {
192
+ let result = [];
193
+ const ctx = {
194
+ register({ nModule, fromPath, file }) {
195
+ result.push(file);
196
+ },
197
+ };
198
+ const param = {
199
+ nModule: {
200
+ module: { paths: {} },
201
+ },
202
+ srcDir: logicsPath,
203
+ };
204
+ notModuleRegistratorLogics.findAll.call(ctx, param);
205
+ expect(result.sort()).to.be.deep.equal(
206
+ ["one.js", "two.js", "three.js"].sort()
207
+ );
208
+ });
209
+ });
149
210
  });
150
-
151
-
152
- describe('register', () => {
153
- const logicsPath = path.join(__dirname, '../testies/module/logics/one.js');
154
- it('file exists', function(done) {
155
- const ctx = {
156
- extend(){}
157
- };
158
- const param = {
159
- nModule:{
160
- module:{ paths:{} },
161
- setLogic(logicName, logic){
162
- expect(logicName).to.be.equal('One');
163
- done();
164
- }
165
- },
166
- fromPath: logicsPath,
167
- file: 'one.js'
168
- };
169
- notModuleRegistratorLogics.prototype.register.call(ctx, param);
170
- expect(res).to.be.false;
171
- });
172
- });
173
-
174
-
175
- describe('findAll', () => {
176
- const logicsPath = path.join(__dirname, '../testies/module/logics');
177
- it('path exists', function() {
178
- let result = [];
179
- const ctx = {
180
- register({nModule, fromPath, file}){
181
- result.push(file);
182
- }
183
- };
184
- const param = {
185
- nModule:{
186
- module:{ paths:{} },
187
- },
188
- srcDir: logicsPath
189
- };
190
- notModuleRegistratorLogics.prototype.findAll.call(ctx, param);
191
- expect(result.sort()).to.be.deep.equal(['one.js', 'two.js', 'three.js'].sort());
192
- });
193
- });
194
-
195
- });
196
211
  };