Commit 4b082141 authored by Adrian Kosmaczewski's avatar Adrian Kosmaczewski

Fixed lint errors in spec

parent 3edd91a9
import { World } from '../src/World'
import { Coord } from '../src/Coord'
import { describe } from 'mocha'
import { describe, it } from 'mocha'
import { expect } from 'chai'
describe('Block', () => {
it('Evolves', () => {
let alive = World.block(new Coord(0, 0))
let original = new World(5, alive)
let next = original.evolve()
expect(JSON.stringify(next.cells)).to.equal(JSON.stringify(original.cells))
})
it('Evolves', () => {
const alive = World.block(new Coord(0, 0))
const original = new World(5, alive)
const next = original.evolve()
expect(next).to.deep.equal(original)
})
})
describe('Tub', () => {
it('Evolves', () => {
let alive = World.tub(new Coord(0, 0))
let original = new World(5, alive)
let next = original.evolve()
expect(JSON.stringify(next.cells)).to.equal(JSON.stringify(original.cells))
})
it('Evolves', () => {
const alive = World.tub(new Coord(0, 0))
const original = new World(5, alive)
const next = original.evolve()
expect(next).to.deep.equal(original)
})
})
describe('Blinker', () => {
it('Evolves', () => {
let alive = World.blinker(new Coord(0, 1))
let original = new World(3, alive)
let gen1 = original.evolve()
let expectedAlive: Coord[] = [
new Coord(1, 0),
new Coord(1, 1),
new Coord(1, 2)
];
let expected = new World(3, expectedAlive)
expect(JSON.stringify(expected.cells)).to.equal(JSON.stringify(gen1.cells))
let gen2 = gen1.evolve()
expect(JSON.stringify(original.cells)).to.equal(JSON.stringify(gen2.cells))
})
it('Evolves', () => {
const alive = World.blinker(new Coord(0, 1))
const original = new World(3, alive)
const gen1 = original.evolve()
const expectedAlive: Coord[] = [
new Coord(1, 0),
new Coord(1, 1),
new Coord(1, 2)
]
const expected = new World(3, expectedAlive)
expect(expected).to.deep.equal(gen1)
const gen2 = gen1.evolve()
expect(original).to.deep.equal(gen2)
})
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment