Skip to content

Commit 8243ca7

Browse files
committed
test: fix chai import
1 parent a6b16c8 commit 8243ca7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/Grid.test.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import chai from 'chai'
1+
import { assert } from 'chai'
22
import Grid from '../src/Grid.js'
33

44
describe('Grid', () => {
@@ -20,7 +20,7 @@ describe('Grid', () => {
2020
it('should set all cells to "dead"', () => {
2121
grid.importGrid(sampleData)
2222
grid.reset()
23-
chai.assert.deepStrictEqual(grid.exportGrid(), [
23+
assert.deepStrictEqual(grid.exportGrid(), [
2424
[0, 0, 0],
2525
[0, 0, 0],
2626
[0, 0, 0],
@@ -45,7 +45,7 @@ describe('Grid', () => {
4545
for (const cell of cells.toggleOff) cell.toggle()
4646
for (const cell of cells.toggleOn) cell.toggle()
4747

48-
chai.assert.deepStrictEqual(grid.exportGrid(), [
48+
assert.deepStrictEqual(grid.exportGrid(), [
4949
[0, 0, 0, 0, 0],
5050
[0, 1, 1, 1, 0],
5151
[0, 1, 0, 1, 0],
@@ -57,7 +57,7 @@ describe('Grid', () => {
5757
for (const cell of cells.toggleOff) cell.toggle()
5858
for (const cell of cells.toggleOn) cell.toggle()
5959

60-
chai.assert.deepStrictEqual(grid.exportGrid(), [
60+
assert.deepStrictEqual(grid.exportGrid(), [
6161
[0, 0, 1, 0, 0],
6262
[0, 1, 0, 1, 0],
6363
[1, 0, 0, 0, 1],
@@ -70,22 +70,22 @@ describe('Grid', () => {
7070
describe('importRLE', () => {
7171
it('should import data in RLE format', () => {
7272
grid.importRLE('1o$1o$2b1o')
73-
chai.assert.deepStrictEqual(grid.exportGrid(), sampleData)
73+
assert.deepStrictEqual(grid.exportGrid(), sampleData)
7474
})
7575
})
7676

7777
describe('exportRLE', () => {
7878
it('should export the grid in RLE format', () => {
7979
grid.importGrid(sampleData)
80-
chai.assert.deepStrictEqual(grid.exportRLE(), '1o$1o$2b1o')
80+
assert.deepStrictEqual(grid.exportRLE(), '1o$1o$2b1o')
8181
})
8282
})
8383

8484
describe('hflip', () => {
8585
it('should flip the grid horizontally', () => {
8686
grid.importGrid(sampleData)
8787
grid.hflip()
88-
chai.assert.deepStrictEqual(grid.exportGrid(), [
88+
assert.deepStrictEqual(grid.exportGrid(), [
8989
[0, 0, 1],
9090
[0, 0, 1],
9191
[1, 0, 0],
@@ -97,7 +97,7 @@ describe('Grid', () => {
9797
it('should flip the grid vertically', () => {
9898
grid.importGrid(sampleData)
9999
grid.vflip()
100-
chai.assert.deepStrictEqual(grid.exportGrid(), [
100+
assert.deepStrictEqual(grid.exportGrid(), [
101101
[0, 0, 1],
102102
[1, 0, 0],
103103
[1, 0, 0],
@@ -109,7 +109,7 @@ describe('Grid', () => {
109109
it('should shift the grid up by 1 row', () => {
110110
grid.importGrid(sampleData)
111111
grid.shiftUp()
112-
chai.assert.deepStrictEqual(grid.exportGrid(), [
112+
assert.deepStrictEqual(grid.exportGrid(), [
113113
[1, 0, 0],
114114
[0, 0, 1],
115115
[0, 0, 0],
@@ -121,7 +121,7 @@ describe('Grid', () => {
121121
it('should shift the grid down by 1 row', () => {
122122
grid.importGrid(sampleData)
123123
grid.shiftDown()
124-
chai.assert.deepStrictEqual(grid.exportGrid(), [
124+
assert.deepStrictEqual(grid.exportGrid(), [
125125
[0, 0, 0],
126126
[1, 0, 0],
127127
[1, 0, 0],
@@ -133,7 +133,7 @@ describe('Grid', () => {
133133
it('should shift the grid left by 1 column', () => {
134134
grid.importGrid(sampleData)
135135
grid.shiftLeft()
136-
chai.assert.deepStrictEqual(grid.exportGrid(), [
136+
assert.deepStrictEqual(grid.exportGrid(), [
137137
[0, 0, 0],
138138
[0, 0, 0],
139139
[0, 1, 0],
@@ -145,7 +145,7 @@ describe('Grid', () => {
145145
it('should shift the grid right by 1 column', () => {
146146
grid.importGrid(sampleData)
147147
grid.shiftRight()
148-
chai.assert.deepStrictEqual(grid.exportGrid(), [
148+
assert.deepStrictEqual(grid.exportGrid(), [
149149
[0, 1, 0],
150150
[0, 1, 0],
151151
[0, 0, 0],

0 commit comments

Comments
 (0)