Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcasals committed Jul 25, 2016
1 parent dcab786 commit f896cf9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
//'src/index.js',
'src/**/*.spec.js'
'src/**/*.spec.ts'
],


Expand All @@ -32,7 +32,7 @@ module.exports = function(config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
//'src/**/*.js': ['webpack'],
'src/**/*.spec.js': ['webpack'],
'src/**/*.spec.ts': ['webpack'],
},


Expand Down
2 changes: 1 addition & 1 deletion src/events/advance_turn.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as event from './advance_turn';
import { make as makeSettlement } from '../models/settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

describe('advanceTurn', () => {
it('advances the turn of the settlement', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/events/gravedigger_works.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as event from './gravedigger_works';
import { make as makePerson, id } from '../models/person';
import { make as makeSettlement } from '../models/settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

describe('gravedigger', () => {
describe('perform', () => {
Expand All @@ -11,7 +11,7 @@ describe('gravedigger', () => {
1,
makePerson({id: 1}),
2,
makePerson({id: 2, dead: true }),
makePerson({id: 2, dead: true })
));

it('removes the dead people', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/events/population_ages.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as event from './population_ages';
import { make as makeSettlement } from '../models/settlement';
import { age } from '../models/person';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

describe('populationAges', () => {
it('makes the population age', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/events/population_breeds.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as event from './population_breeds';
import { make as makePerson, id, age } from '../models/person';
import { make as makeTown } from '../models/settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

let random = () => 0;

Expand All @@ -10,7 +10,7 @@ describe('populationBreeds', () => {
1,
makePerson({ id: 1, marriedTo: 2, gender: 'male' }),
2,
makePerson({ id: 2, marriedTo: 1, gender: 'female' }),
makePerson({ id: 2, marriedTo: 1, gender: 'female' })
);
let town = makeTown({ people: 0 })
.set('people', people);
Expand Down
2 changes: 1 addition & 1 deletion src/events/population_eats.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as event from './population_eats';
import { make as makeSettlement } from '../models/settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

describe('populationEats', () => {
it('makes the population eat', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/events/population_marries.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as event from './population_marries';
import { make as makePerson, isSingle, gender, isMarried, marriedTo, id } from '../models/person';
import { make as makeSettlement } from '../models/settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

let randomness = () => 0.5;

Expand All @@ -12,7 +12,7 @@ describe('populationMarries', () => {
1,
makePerson({ id: 1, age: 16, gender: 'male' }),
2,
makePerson({ id: 2, gender: 'female' }),
makePerson({ id: 2, gender: 'female' })
));

it('does not marry them', () => {
Expand All @@ -32,7 +32,7 @@ describe('populationMarries', () => {
2,
makePerson({ id: 2, age: 20, gender: 'female' }),
3,
makePerson({ id: 3, age: 20, gender: 'male' }),
makePerson({ id: 3, age: 20, gender: 'male' })
));

it('marries them', () => {
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('populationMarries', () => {
4,
makePerson({ id: 4, age: 20, gender: 'female', marriedTo: 5 }),
5,
makePerson({ id: 5, age: 20, gender: 'male', marriedTo: 4 }),
makePerson({ id: 5, age: 20, gender: 'male', marriedTo: 4 })
));

it('does not remarry people with a partner', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/models/settlement.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as settlement from './settlement';
import Immutable from 'immutable';
import * as Immutable from 'immutable';

describe('Settlement', () => {
describe('make', () => {
Expand Down
2 changes: 2 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
},
"globalDependencies": {
"immutable": "file:./node_modules/immutable/dist/immutable.d.ts",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160720070758",
"require": "registry:dt/require#2.1.20+20160316155526"
}
}

0 comments on commit f896cf9

Please sign in to comment.