This repository has been archived by the owner on Apr 7, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continued porting to react, approaching beta
- Loading branch information
Colin McLeod
committed
Jan 22, 2016
1 parent
653cb30
commit 8227a4e
Showing
86 changed files
with
3,799 additions
and
2,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
{ | ||
"stage": 0, | ||
"env": { | ||
"development": { | ||
"plugins": ["react-transform"], | ||
"extra": { | ||
"react-transform": { | ||
"transforms": [{ | ||
"transform": "react-transform-hmr", | ||
"imports": ["react"], | ||
"locals": ["module"] | ||
}, { | ||
"transform": "react-transform-catch-errors", | ||
"imports": ["react", "redbox-react"] | ||
}] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
"presets": ["es2015", "react", "stage-0"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
test/tests/test-controller-import.js → __tests__/test-controller-import.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import Ship from '../src/app/shipyard/Ship'; | ||
import { Ships } from 'coriolis-data'; | ||
import * as Serializer from '../src/app/shipyard/Serializer'; | ||
|
||
describe("Serializer Service", function() { | ||
|
||
const anacondaTestExport = require.requireActual('./fixtures/anaconda-test-detailed-export-v3'); | ||
const code = anacondaTestExport.references[0].code; | ||
const anaconda = Ships.anaconda; | ||
|
||
describe("To Detailed Build", function() { | ||
|
||
let testBuild, exportData; | ||
|
||
beforeEach(function() { | ||
testBuild = new Ship('anaconda', anaconda.properties, anaconda.slots); | ||
testBuild.buildFrom(code); | ||
exportData = Serializer.toDetailedBuild('Test', testBuild); | ||
}); | ||
|
||
xit("conforms to the v2 ship-loadout schema", function() { | ||
// var validate = jsen(require('../schemas/ship-loadout/3')); | ||
// var valid = validate(exportData); | ||
expect(valid).toBeTruthy(); | ||
}); | ||
|
||
it("contains the correct components and stats", function() { | ||
expect(exportData.components).toEqual(anacondaTestExport.components); | ||
expect(exportData.stats).toEqual(anacondaTestExport.stats); | ||
expect(exportData.ship).toEqual(anacondaTestExport.ship); | ||
expect(exportData.name).toEqual(anacondaTestExport.name); | ||
}); | ||
|
||
}); | ||
|
||
describe("From Detailed Build", function() { | ||
|
||
it("builds the ship correctly", function() { | ||
let testBuildA = new Ship('anaconda', anaconda.properties, anaconda.slots); | ||
testBuildA.buildFrom(code); | ||
let testBuildB = Serializer.fromDetailedBuild(anacondaTestExport); | ||
|
||
for(var p in testBuildB) { | ||
if (p == 'availCS') { | ||
continue; | ||
} | ||
expect(testBuildB[p]).toEqual(testBuildA[p], p + ' does not match'); | ||
} | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.