-
Notifications
You must be signed in to change notification settings - Fork 400
/
release.test.js
36 lines (28 loc) · 1.31 KB
/
release.test.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
/* global describe, it, __dirname */
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var packageJSON = require('../../../../package.json');
var bowerJSON = require('../../../../bower.json');
var versionFile = fs.readFileSync(path.resolve(__dirname, '../../../../VERSION'), 'UTF-8');
var readMe = fs.readFileSync(path.resolve(__dirname, '../../../../README.md'), 'UTF-8');
describe('release should be consistent', function () {
it('with a matching bower and npm module', function () {
assert.equal(packageJSON.version, bowerJSON.version);
});
it('with have a matching VERSION', function () {
assert.equal(versionFile, bowerJSON.version);
});
it('with bower valid entry point', function () {
assert.equal(bowerJSON.main, 'web/dist/pubnub.min.js');
});
it('with npm valid entry point', function () {
assert.equal(packageJSON.main, './node.js/pubnub.js');
});
it('with updated readme', function () {
assert(readMe.indexOf('http://cdn.pubnub.com/pubnub-' + versionFile + '.js') > 1);
assert(readMe.indexOf('http://cdn.pubnub.com/pubnub-' + versionFile + '.min.js') > 1);
assert(readMe.indexOf('https://cdn.pubnub.com/pubnub-' + versionFile + '.js') > 1);
assert(readMe.indexOf('https://cdn.pubnub.com/pubnub-' + versionFile + '.min.js') > 1);
});
});