aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2022-01-20 18:55:01 -0500
committerPriyansh <[email protected]>2022-01-20 18:55:01 -0500
commit90be11f8e8ad16ef2a68d71d4523f813db18e6ef (patch)
tree19b9fced8668b83066f3f98a95af67877e721072 /tests
parentd0352ed005d0bceb345368274bff4c4c605ed396 (diff)
downloadizuku.js-90be11f8e8ad16ef2a68d71d4523f813db18e6ef.tar.xz
izuku.js-90be11f8e8ad16ef2a68d71d4523f813db18e6ef.zip
feat: added arrayFunctions and rename Izuku to Frame
Diffstat (limited to 'tests')
-rw-r--r--tests/columns.test.ts24
-rw-r--r--tests/frames.test.ts6
-rw-r--r--tests/info.test.ts4
-rw-r--r--tests/printing.test.ts4
4 files changed, 31 insertions, 7 deletions
diff --git a/tests/columns.test.ts b/tests/columns.test.ts
new file mode 100644
index 0000000..32fb6f1
--- /dev/null
+++ b/tests/columns.test.ts
@@ -0,0 +1,24 @@
+import { Frame } from '../src/index';
+import { data, header } from './support/people';
+import { expect } from 'chai';
+
+const frame = new Frame(data, header);
+
+describe('columns.ts', () => {
+ describe('Get a single column', () => {
+ it('should return a column of the frame using column name', () => {
+ const dataToExpect = [
+ 'Arthur',
+ 'Betty',
+ 'Victor',
+ 'Dodger',
+ 'Rayan',
+ 'Skitley',
+ 'Victoria',
+ 'Tiger',
+ 'Killjoy'
+ ];
+ expect(frame.column('Name').flatten()).to.deep.equal(dataToExpect);
+ });
+ });
+});
diff --git a/tests/frames.test.ts b/tests/frames.test.ts
index ca4ad35..05ded5c 100644
--- a/tests/frames.test.ts
+++ b/tests/frames.test.ts
@@ -1,5 +1,5 @@
import { expect } from 'chai';
-import Izuku from '../src/index';
+import { Frame } from '../src/index';
const data = [
['a', 'b', 'c'],
@@ -20,7 +20,7 @@ const changedHeader = ['j', 'k', 'l'];
describe('frames.test.ts', () => {
describe('Create a new frame with column names', () => {
it('should create a new frame', () => {
- const frame = new Izuku(data);
+ const frame = new Frame(data);
expect(frame.rowdata).to.deep.equal(data);
frame.header(header);
expect(frame.columns).to.deep.equal(header);
@@ -28,7 +28,7 @@ describe('frames.test.ts', () => {
});
describe('Update a frame and column names', () => {
it('should update a frame', () => {
- const frame = new Izuku(data);
+ const frame = new Frame(data);
frame.header(header);
expect(frame.rowdata).to.deep.equal(data);
expect(frame.columns).to.deep.equal(header);
diff --git a/tests/info.test.ts b/tests/info.test.ts
index c761e7f..3f8c3dc 100644
--- a/tests/info.test.ts
+++ b/tests/info.test.ts
@@ -1,8 +1,8 @@
-import Izuku from '../src/index';
+import { Frame } from '../src/index';
import { expect } from 'chai';
import { data, header } from './support/people';
-const frame = new Izuku(data, header);
+const frame = new Frame(data, header);
describe('info.ts', () => {
describe('Print size of frame', () => {
diff --git a/tests/printing.test.ts b/tests/printing.test.ts
index 49b53b2..6f025c9 100644
--- a/tests/printing.test.ts
+++ b/tests/printing.test.ts
@@ -1,7 +1,7 @@
-import Izuku from '../src/index';
+import { Frame } from '../src/index';
import { data, header } from './support/people';
-const frame = new Izuku(data, header);
+const frame = new Frame(data, header);
describe('printing.test.ts', () => {
describe('Print a frame', () => {