mirror of
https://github.com/EDCD/coriolis-data.git
synced 2025-12-08 15:13:23 +00:00
Adding travis.yml
This commit is contained in:
@@ -6,10 +6,10 @@ var exportString = JSON.stringify({ Ships: Ships, Modules: Modules }, null, '\t'
|
|||||||
var ast = UglifyJS.parse(['module.exports = ', JSON.stringify({ Ships: Ships, Modules: Modules }), ';'].join(''));
|
var ast = UglifyJS.parse(['module.exports = ', JSON.stringify({ Ships: Ships, Modules: Modules }), ';'].join(''));
|
||||||
var code = ast.print_to_string({beautify: true, indent_level: 2});
|
var code = ast.print_to_string({beautify: true, indent_level: 2});
|
||||||
|
|
||||||
fs.open('./index.js', 'w', function() {
|
fs.open('./dist/index.json', 'w', function() {
|
||||||
fs.writeFile('./dist/index.js', code, function(err) {});
|
fs.writeFile('./dist/index.js', code, function(err) {});
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.open('./index.json', 'w', function() {
|
fs.open('./dist/index.json', 'w', function() {
|
||||||
fs.writeFile('./dist/index.json', exportString, function(err) {});
|
fs.writeFile('./dist/index.json', exportString, function(err) {});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
var Modules = require('../Modules');
|
var Modules = require('../Modules');
|
||||||
var Ships = require('../Ships');
|
var Ships = require('../Ships');
|
||||||
|
|
||||||
describe('Database', function() {
|
describe('JSON Data', function() {
|
||||||
|
|
||||||
var shipProperties = [
|
var shipProperties = [
|
||||||
'name',
|
'name',
|
||||||
@@ -19,25 +19,10 @@ describe('Database', function() {
|
|||||||
'pipSpeed'
|
'pipSpeed'
|
||||||
];
|
];
|
||||||
|
|
||||||
it('has same number of components as EDDB', function() {
|
it('has an up-to-date distribution', function() {
|
||||||
var totalComponentCount = 0, g;
|
var dist = require('../dist/index.js');
|
||||||
for (g = 0; g < Modules.standard.length; g++) {
|
expect(dist.Ships).toEqual(Ships);
|
||||||
var group = Modules.standard[g];
|
expect(dist.Modules).toEqual(Modules);
|
||||||
for (var i in group) {
|
|
||||||
totalComponentCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (g in Modules.bulkheads) {
|
|
||||||
totalComponentCount += 5;
|
|
||||||
}
|
|
||||||
for (g in Modules.hardpoints) {
|
|
||||||
totalComponentCount += Modules.hardpoints[g].length;
|
|
||||||
}
|
|
||||||
for (g in Modules.internal) {
|
|
||||||
if (g != 'ft') { // EDDB does not have internal fuel tanks listed seperately
|
|
||||||
totalComponentCount += Modules.internal[g].length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has valid standard components', function() {
|
it('has valid standard components', function() {
|
||||||
|
|||||||
14
travis.yml
Normal file
14
travis.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
language: node_js
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
sudo: false
|
||||||
|
node_js:
|
||||||
|
- "4.2.6"
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
|
||||||
|
script:
|
||||||
|
- npm test
|
||||||
Reference in New Issue
Block a user