Skip to content

Commit 527d4bf

Browse files
Minor refactoring
1 parent bc9a580 commit 527d4bf

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

tests/_utils.js renamed to tests/_helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
'use strict';
33

44
/**
5-
* Utility methods for use in tests
5+
* Helper methods for use in tests
66
*/
7-
global.utils = {
7+
global.helper = {
88
forEachMethod: forEachMethod,
99
matchesJSON: matchesJSON
1010
};

tests/formatter.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('ono.formatter', function() {
2828
expect(err.message).to.equal('4 must be greater than 10');
2929

3030
var json = JSON.parse(JSON.stringify(err));
31-
expect(json).to.satisfy(utils.matchesJSON({
31+
expect(json).to.satisfy(helper.matchesJSON({
3232
name: err.name,
3333
message: err.message,
3434
stack: err.stack
@@ -45,7 +45,7 @@ describe('ono.formatter', function() {
4545
expect(err.message).to.equal('4 must be greater than 10');
4646

4747
var json = JSON.parse(JSON.stringify(err));
48-
expect(json).to.satisfy(utils.matchesJSON({
48+
expect(json).to.satisfy(helper.matchesJSON({
4949
name: err.name,
5050
message: err.message,
5151
stack: err.stack

tests/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<!-- Unit Tests -->
2525
<script src="_config.js"></script>
26-
<script src="_utils.js"></script>
26+
<script src="_helper.js"></script>
2727
<script src="ono.spec.js"></script>
2828
<script src="formatter.spec.js"></script>
2929

tests/ono.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
1+
helper.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
22
'use strict';
33

44
describe(name, function() {
@@ -18,7 +18,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
1818
}
1919

2020
var json = JSON.parse(JSON.stringify(err));
21-
expect(json).to.satisfy(utils.matchesJSON({
21+
expect(json).to.satisfy(helper.matchesJSON({
2222
name: err.name,
2323
message: err.message,
2424
stack: err.stack
@@ -41,7 +41,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
4141
}
4242

4343
var json = JSON.parse(JSON.stringify(err));
44-
expect(json).to.satisfy(utils.matchesJSON({
44+
expect(json).to.satisfy(helper.matchesJSON({
4545
name: err.name,
4646
message: err.message,
4747
stack: err.stack
@@ -64,7 +64,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
6464
}
6565

6666
var json = JSON.parse(JSON.stringify(err));
67-
expect(json).to.satisfy(utils.matchesJSON({
67+
expect(json).to.satisfy(helper.matchesJSON({
6868
name: err.name,
6969
message: err.message,
7070
stack: err.stack
@@ -87,7 +87,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
8787
}
8888

8989
var json = JSON.parse(JSON.stringify(err));
90-
expect(json).to.satisfy(utils.matchesJSON({
90+
expect(json).to.satisfy(helper.matchesJSON({
9191
name: err.name,
9292
message: err.message,
9393
stack: err.stack
@@ -110,7 +110,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
110110
}
111111

112112
var json = JSON.parse(JSON.stringify(err));
113-
expect(json).to.satisfy(utils.matchesJSON({
113+
expect(json).to.satisfy(helper.matchesJSON({
114114
name: err.name,
115115
message: err.message,
116116
stack: err.stack
@@ -142,7 +142,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
142142
}
143143

144144
var json = JSON.parse(JSON.stringify(err));
145-
expect(json).to.satisfy(utils.matchesJSON({
145+
expect(json).to.satisfy(helper.matchesJSON({
146146
name: err.name,
147147
message: err.message,
148148
stack: err.stack
@@ -174,7 +174,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
174174
}
175175

176176
var json = JSON.parse(JSON.stringify(err));
177-
expect(json).to.satisfy(utils.matchesJSON({
177+
expect(json).to.satisfy(helper.matchesJSON({
178178
name: err.name,
179179
message: err.message,
180180
stack: err.stack
@@ -206,7 +206,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
206206
}
207207

208208
var json = JSON.parse(JSON.stringify(err));
209-
expect(json).to.satisfy(utils.matchesJSON({
209+
expect(json).to.satisfy(helper.matchesJSON({
210210
name: err.name,
211211
message: err.message,
212212
stack: err.stack
@@ -241,7 +241,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
241241
}
242242

243243
var json = JSON.parse(JSON.stringify(err));
244-
expect(json).to.satisfy(utils.matchesJSON({
244+
expect(json).to.satisfy(helper.matchesJSON({
245245
name: err.name,
246246
message: err.message,
247247
stack: err.stack,
@@ -288,7 +288,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
288288
}
289289

290290
var json = JSON.parse(JSON.stringify(err));
291-
expect(json).to.satisfy(utils.matchesJSON({
291+
expect(json).to.satisfy(helper.matchesJSON({
292292
name: err.name,
293293
message: err.message,
294294
stack: err.stack,
@@ -326,7 +326,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
326326
}
327327

328328
var json = JSON.parse(JSON.stringify(err));
329-
expect(json).to.satisfy(utils.matchesJSON({
329+
expect(json).to.satisfy(helper.matchesJSON({
330330
name: err.name,
331331
message: err.message,
332332
stack: err.stack,
@@ -363,7 +363,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
363363
}
364364

365365
var json = JSON.parse(JSON.stringify(err));
366-
expect(json).to.satisfy(utils.matchesJSON({
366+
expect(json).to.satisfy(helper.matchesJSON({
367367
name: err.name,
368368
message: err.message,
369369
stack: err.stack,
@@ -414,7 +414,7 @@ utils.forEachMethod(function(name, ono, ErrorType, ErrorTypeName) {
414414
}
415415

416416
var json = JSON.parse(JSON.stringify(err));
417-
expect(json).to.satisfy(utils.matchesJSON({
417+
expect(json).to.satisfy(helper.matchesJSON({
418418
name: err.name,
419419
message: err.message,
420420
stack: err.stack,

0 commit comments

Comments
 (0)