1
- import chai from 'chai'
1
+ import { assert } from 'chai'
2
2
import Grid from '../src/Grid.js'
3
3
4
4
describe ( 'Grid' , ( ) => {
@@ -20,7 +20,7 @@ describe('Grid', () => {
20
20
it ( 'should set all cells to "dead"' , ( ) => {
21
21
grid . importGrid ( sampleData )
22
22
grid . reset ( )
23
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
23
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
24
24
[ 0 , 0 , 0 ] ,
25
25
[ 0 , 0 , 0 ] ,
26
26
[ 0 , 0 , 0 ] ,
@@ -45,7 +45,7 @@ describe('Grid', () => {
45
45
for ( const cell of cells . toggleOff ) cell . toggle ( )
46
46
for ( const cell of cells . toggleOn ) cell . toggle ( )
47
47
48
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
48
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
49
49
[ 0 , 0 , 0 , 0 , 0 ] ,
50
50
[ 0 , 1 , 1 , 1 , 0 ] ,
51
51
[ 0 , 1 , 0 , 1 , 0 ] ,
@@ -57,7 +57,7 @@ describe('Grid', () => {
57
57
for ( const cell of cells . toggleOff ) cell . toggle ( )
58
58
for ( const cell of cells . toggleOn ) cell . toggle ( )
59
59
60
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
60
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
61
61
[ 0 , 0 , 1 , 0 , 0 ] ,
62
62
[ 0 , 1 , 0 , 1 , 0 ] ,
63
63
[ 1 , 0 , 0 , 0 , 1 ] ,
@@ -70,22 +70,22 @@ describe('Grid', () => {
70
70
describe ( 'importRLE' , ( ) => {
71
71
it ( 'should import data in RLE format' , ( ) => {
72
72
grid . importRLE ( '1o$1o$2b1o' )
73
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , sampleData )
73
+ assert . deepStrictEqual ( grid . exportGrid ( ) , sampleData )
74
74
} )
75
75
} )
76
76
77
77
describe ( 'exportRLE' , ( ) => {
78
78
it ( 'should export the grid in RLE format' , ( ) => {
79
79
grid . importGrid ( sampleData )
80
- chai . assert . deepStrictEqual ( grid . exportRLE ( ) , '1o$1o$2b1o' )
80
+ assert . deepStrictEqual ( grid . exportRLE ( ) , '1o$1o$2b1o' )
81
81
} )
82
82
} )
83
83
84
84
describe ( 'hflip' , ( ) => {
85
85
it ( 'should flip the grid horizontally' , ( ) => {
86
86
grid . importGrid ( sampleData )
87
87
grid . hflip ( )
88
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
88
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
89
89
[ 0 , 0 , 1 ] ,
90
90
[ 0 , 0 , 1 ] ,
91
91
[ 1 , 0 , 0 ] ,
@@ -97,7 +97,7 @@ describe('Grid', () => {
97
97
it ( 'should flip the grid vertically' , ( ) => {
98
98
grid . importGrid ( sampleData )
99
99
grid . vflip ( )
100
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
100
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
101
101
[ 0 , 0 , 1 ] ,
102
102
[ 1 , 0 , 0 ] ,
103
103
[ 1 , 0 , 0 ] ,
@@ -109,7 +109,7 @@ describe('Grid', () => {
109
109
it ( 'should shift the grid up by 1 row' , ( ) => {
110
110
grid . importGrid ( sampleData )
111
111
grid . shiftUp ( )
112
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
112
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
113
113
[ 1 , 0 , 0 ] ,
114
114
[ 0 , 0 , 1 ] ,
115
115
[ 0 , 0 , 0 ] ,
@@ -121,7 +121,7 @@ describe('Grid', () => {
121
121
it ( 'should shift the grid down by 1 row' , ( ) => {
122
122
grid . importGrid ( sampleData )
123
123
grid . shiftDown ( )
124
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
124
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
125
125
[ 0 , 0 , 0 ] ,
126
126
[ 1 , 0 , 0 ] ,
127
127
[ 1 , 0 , 0 ] ,
@@ -133,7 +133,7 @@ describe('Grid', () => {
133
133
it ( 'should shift the grid left by 1 column' , ( ) => {
134
134
grid . importGrid ( sampleData )
135
135
grid . shiftLeft ( )
136
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
136
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
137
137
[ 0 , 0 , 0 ] ,
138
138
[ 0 , 0 , 0 ] ,
139
139
[ 0 , 1 , 0 ] ,
@@ -145,7 +145,7 @@ describe('Grid', () => {
145
145
it ( 'should shift the grid right by 1 column' , ( ) => {
146
146
grid . importGrid ( sampleData )
147
147
grid . shiftRight ( )
148
- chai . assert . deepStrictEqual ( grid . exportGrid ( ) , [
148
+ assert . deepStrictEqual ( grid . exportGrid ( ) , [
149
149
[ 0 , 1 , 0 ] ,
150
150
[ 0 , 1 , 0 ] ,
151
151
[ 0 , 0 , 0 ] ,
0 commit comments