-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.test.js
30 lines (28 loc) · 978 Bytes
/
index.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
const expect = require('chai').expect;
const Santari = require('../src/tasks/santari');
const path = require('path');
describe('santari', () => {
describe('validations', () => {
it('should error out if ENV var is not found', () => {
process.env.GITHUB_KEY = '';
try {
new Santari(); // eslint-disable-line
} catch (error) {
expect(error).to.be.not.eql(null);
}
});
});
});
describe('processing', () => {
it('should not override locked versions', () => {
process.env.GITHUB_KEY = process.env.GITHUB_KEY_BAK; // on CI env var.
const check = new Santari('jeremyrajan/santari');
check.packageTempPath = path.join(__dirname, 'mock.json');
check.packageJSON = require('./mock.json'); // eslint-disable-line
return check.checkForUpdates()
.then((res) => {
expect(res.dependencies.cucumber).to.be.eql('1.3.1');
expect(res.dependencies.eslint).to.be.not.eql('3.11.1');
});
});
});