Skip to content

Instantly share code, notes, and snippets.

@arv
Last active April 11, 2022 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arv/0a3f7b5c0b831f15b5eaaea7a5e5a725 to your computer and use it in GitHub Desktop.
Save arv/0a3f7b5c0b831f15b5eaaea7a5e5a725 to your computer and use it in GitHub Desktop.
fractional-indexing and Jest
node --version # v17.9.0
npm --version # 8.5.5
npm install
npm run test
{
"name": "frac-index-jest",
"type": "module",
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"dependencies": {
"fractional-indexing": "^3.0.0",
"jest": "^27.5.1"
}
}
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