Skip to content

Commit f6ac520

Browse files
Renamed the "tests" folder to "test", since that's the default that Mocha expects. Also added a mocha.opts file
1 parent ca633e5 commit f6ac520

File tree

145 files changed

+29
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+29
-25
lines changed

.codeclimate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ languages:
33
exclude_paths:
44
- "dist/*"
55
- "node_modules/*"
6-
- "tests/*"
6+
- "test/*"
77
- "coverage/*"
88
- "karma.conf.js"
99
- "www/*"

.jscsrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"excludeFiles": [
33
"coverage/**",
4-
"tests/**",
4+
"test/**",
55
"dist/**",
66
"www/**",
77
"node_modules/**"

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ npm-debug.log
99
/dist/*.test.js
1010
/docs
1111
karma.conf.js
12-
/tests
12+
/test
1313
/www
1414
bower.json
1515
index.html

CHANGELOG.md

+1-1

README.md

+3-3

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"/lib",
2222
"/www",
2323
"/dist/*.test.js",
24-
"/tests",
24+
"/test",
2525
"/karma.conf.js",
2626
"/.*",
2727
"/index.html",

karma.conf.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ var baseConfig = {
1515
{pattern: 'dist/*.map', included: false, served: true},
1616

1717
// Test Fixtures
18-
'tests/fixtures/**/*.js',
18+
'test/fixtures/**/*.js',
1919

2020
// Tests
21-
'tests/specs/**/*.js',
22-
{pattern: 'tests/specs/**', included: false, served: true}
21+
'test/specs/**/*.js',
22+
{pattern: 'test/specs/**', included: false, served: true}
2323
]
2424
};
2525

@@ -172,8 +172,8 @@ function configureSauceLabs(config) {
172172
// probably due to zero-byte files and special characters in the paths.
173173
// So, exclude these tests when running on SauceLabs.
174174
config.exclude = [
175-
'tests/specs/__*/**',
176-
'tests/specs/blank/**',
177-
'tests/specs/parsers/**'
175+
'test/specs/__*/**',
176+
'test/specs/blank/**',
177+
'test/specs/parsers/**'
178178
];
179179
}

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"build": "npm run lint && npm run browserify",
2525
"browserify": "simplifyify lib/index.js --outfile dist/ref-parser.js --standalone \\$RefParser --bundle --debug --minify",
2626
"watch": "npm run browserify -- --watch",
27-
"mocha": "mocha --bail --recursive tests/fixtures tests/specs",
28-
"istanbul": "istanbul cover _mocha --dir coverage/node -- --bail --recursive tests/fixtures tests/specs",
27+
"mocha": "mocha",
28+
"istanbul": "istanbul cover _mocha --dir coverage/node",
2929
"karma": "karma start --single-run",
3030
"test": "npm run browserify -- --test && npm run istanbul && npm run karma",
3131
"upgrade": "ncu --upgradeAll && npm update && bower update",
@@ -63,9 +63,9 @@
6363
},
6464
"dependencies": {
6565
"call-me-maybe": "^1.0.1",
66-
"debug": "^2.2.0",
6766
"es6-promise": "^3.1.2",
6867
"js-yaml": "^3.5.5",
69-
"ono": "^2.2.1"
68+
"ono": "^2.2.1",
69+
"z-schema": "^3.17.0"
7070
}
71-
}
71+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/fixtures/path.js renamed to test/fixtures/path.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
file = encodeFile(file);
2727

2828
if (window.location.href.indexOf(_testsDir) === 0) {
29-
// Return the relative path from "/tests/index.html"
29+
// Return the relative path from "/test/index.html"
3030
return file;
3131
}
3232

3333
// We're running in a test-runner (such as Karma), so return an absolute path,
34-
// since we don't know the relative path of the "tests" directory.
34+
// since we don't know the relative path of the "test" directory.
3535
return _testsDir.replace(/^https?:\/\/[^\/]+(\/.*)/, '$1' + file);
3636
};
3737

@@ -53,11 +53,11 @@
5353
};
5454

5555
/**
56-
* Returns the path of a file in the "tests" directory as a URL.
56+
* Returns the path of a file in the "test" directory as a URL.
5757
*/
5858
path.url = function(file) {
5959
if (userAgent.isBrowser) {
60-
// In browsers, just return the absolute URL (e.g. "http://localhost/tests/files/...")
60+
// In browsers, just return the absolute URL (e.g. "http://localhost/test/files/...")
6161
return path.abs(file);
6262
}
6363

File renamed without changes.

test/mocha.opts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--recursive
2+
--recursive
3+
test/fixtures
4+
test/specs
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/specs/object-source/object-source.parsed.js renamed to test/specs/object-source/object-source.parsed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var pathToTestsDirectory = global.__karma__ ? '/base/tests/' : '';
1+
var pathToTestsDirectory = global.__karma__ ? '/base/test/' : '';
22

33
helper.parsed.objectSource =
44
{
File renamed without changes.

tests/specs/parsers/parsers.spec.js renamed to test/specs/parsers/parsers.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('References to non-JSON files', function() {
146146
parse: {
147147
// A custom parser that returns the contents of ".foo" files, in reverse
148148
reverseFooParser: {
149-
canParse: /\.foo$/,
149+
canParse: ['.foo'],
150150

151151
parse: function(file) {
152152
return new Promise(function(resolve, reject) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)