diff options
| author | Priyansh <[email protected]> | 2022-01-22 23:14:55 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2022-01-22 23:14:55 -0500 |
| commit | 9e486eb652d0f8576dd2d70dfb296f763320eeb4 (patch) | |
| tree | 91072e138c1d74405b85fe3a7ae2359b43d70d90 /tests/data.test.ts | |
| parent | 11b97b61f99504442773c546c940af8c82c6cb34 (diff) | |
| download | izuku.js-9e486eb652d0f8576dd2d70dfb296f763320eeb4.tar.xz izuku.js-9e486eb652d0f8576dd2d70dfb296f763320eeb4.zip | |
feat: function to find some data in the frame
Diffstat (limited to 'tests/data.test.ts')
| -rw-r--r-- | tests/data.test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/data.test.ts b/tests/data.test.ts index d922a66..b68bdcd 100644 --- a/tests/data.test.ts +++ b/tests/data.test.ts @@ -1,6 +1,7 @@ import { Frame } from '../src/index'; import { expect } from 'chai'; import JSONData from './support/users.json'; +import { data, header } from './support/people'; import path = require('path'); describe('data.ts', () => { @@ -74,4 +75,15 @@ describe('data.ts', () => { expect(new Frame().fromCSV(csvPath).columns).to.deep.equal(header); }); }); + describe('find', () => { + it('should search for a specific value', () => { + const frame = new Frame(data, header).find('Victor', { + column: 'Name', + row: 6, + strict: false + }); + expect(frame.rowdata).to.deep.equal([data[6]]); + expect(frame.columns).to.deep.equal(header); + }); + }); }); |
