Skip to content

Commit

Permalink
add tests to non-strict fen validation option
Browse files Browse the repository at this point in the history
  • Loading branch information
snk-js committed Jun 4, 2023
1 parent fcb6be2 commit f8251ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions __tests__/validate_fen.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { validateFen } from '../src/chess'
import { Chess } from '../src/chess'

test.each([
{
Expand Down Expand Up @@ -522,3 +523,9 @@ test.each([
}
expect(validateFen(fen)).toMatchObject({ ok })
})

test('test non-strict fen validation', () => {
const noKingFen = '8/8/8/8/4R3/8/8/8 w - - 0 1'
const chess = new Chess(noKingFen, false)
expect(chess.fen()).toBe(noKingFen)
})

0 comments on commit f8251ae

Please sign in to comment.