node --version # v17.9.0
npm --version # 8.5.5
npm install
npm run test
Last active
September 7, 2024 13:23
-
-
Save arv/0a3f7b5c0b831f15b5eaaea7a5e5a725 to your computer and use it in GitHub Desktop.
fractional-indexing and Jest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "frac-index-jest", | |
"type": "module", | |
"scripts": { | |
"test": "NODE_OPTIONS=--experimental-vm-modules jest" | |
}, | |
"dependencies": { | |
"fractional-indexing": "^3.0.0", | |
"jest": "^27.5.1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generateKeyBetween } from 'fractional-indexing'; | |
import { expect, test } from '@jest/globals'; | |
test('x', () => { | |
expect(generateKeyBetween(null, null)).toEqual('a0'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment