diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-01-08 22:27:01 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-01-08 22:27:10 +0530 |
| commit | aa006086f69c827d780e6e0e69947ca7ee6e2c70 (patch) | |
| tree | 2330a10402d31d7a8d47e09de0ccd6c6d18764b8 /tests | |
| parent | 2b8ceabd93205f2f852aa08d5fcdc4a8151ae131 (diff) | |
| download | elxr-aa006086f69c827d780e6e0e69947ca7ee6e2c70.tar.gz elxr-aa006086f69c827d780e6e0e69947ca7ee6e2c70.zip | |
feat: adds exposed filter function
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/basic.spec.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts new file mode 100644 index 0000000..d964053 --- /dev/null +++ b/tests/basic.spec.ts @@ -0,0 +1,12 @@ +import { filter } from '../src' + +describe('Basic tests', () => { + it('should do it', () => { + expect(filter(/\s/, [1, '2', 3, '4'])).toEqual(['2', '4']) + expect(filter(/\n/, [1, '2', 3, '4'])).toEqual([1, 3]) + expect(filter(/\T/, [1, 0, '4', ''])).toEqual([1, '4']) + expect(filter(/\F/, [1, 0, '4', ''])).toEqual([0, '']) + expect(filter(/\F\T/, [1, 0, '4', ''])).toEqual([]) + expect(filter(/\s\T/, [1, 0, '4', ''])).toEqual(['4']) + }) +}) |
