forked from cujojs/rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion-test-node.js
48 lines (39 loc) · 1.44 KB
/
version-test-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright 2012-2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (buster, define) {
'use strict';
var assert, refute;
assert = buster.assertions.assert;
refute = buster.assertions.refute;
define('rest-test/version-test', function (require) {
var bowerJson, packageJson;
bowerJson = require('rest/bower.json');
packageJson = require('rest/package.json');
buster.testCase('rest/version', {
'should have the same name for package.json and bower.json': function () {
assert.same(bowerJson.name, packageJson.name);
},
'should have the same version for package.json and bower.json': function () {
assert.same(bowerJson.version, packageJson.version);
},
'should have the same depenencies for package.json and bpwer.json': function () {
// this may not always hold true, but it currently does
assert.equals(bowerJson.dependencies, packageJson.dependencies);
}
});
});
}(
this.buster || require('buster'),
typeof define === 'function' && define.amd ? define : function (id, factory) {
var packageName = id.split(/[\/\-]/)[0], pathToRoot = id.replace(/[^\/]+/g, '..');
pathToRoot = pathToRoot.length > 2 ? pathToRoot.substr(3) : pathToRoot;
factory(function (moduleId) {
return require(moduleId.indexOf(packageName) === 0 ? pathToRoot + moduleId.substr(packageName.length) : moduleId);
});
}
// Boilerplate for AMD and Node
));