aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2022-01-18 21:14:46 -0500
committerPriyansh <[email protected]>2022-01-18 21:14:46 -0500
commit14e3ff569238320f589f42a394f4be739f52f528 (patch)
treecafd9ddb8bef222df3e1852927c58ed43b2406ac /tests
parentd6591bf7dbddb08b10bcee6d667655b7942f6274 (diff)
downloadizuku.js-14e3ff569238320f589f42a394f4be739f52f528.tar.xz
izuku.js-14e3ff569238320f589f42a394f4be739f52f528.zip
feat: added basic frame, tests and tsconfig exclude
Diffstat (limited to 'tests')
-rw-r--r--tests/frames.ts49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/frames.ts b/tests/frames.ts
new file mode 100644
index 0000000..d98f9fe
--- /dev/null
+++ b/tests/frames.ts
@@ -0,0 +1,49 @@
+import { expect } from 'chai';
+import Izuku from '../src/index';
+
+describe('frames.ts', () => {
+ describe('Create a new frame with column names', () => {
+ it('should create a new frame', () => {
+ const newframe = new Izuku([
+ ['a', 'b', 'c'],
+ ['d', 'e', 'f'],
+ ['g', 'h', 'i']
+ ]);
+ expect(newframe.frame()).to.deep.equal([
+ ['a', 'b', 'c'],
+ ['d', 'e', 'f'],
+ ['g', 'h', 'i']
+ ]);
+ newframe.columns(['a', 'b', 'c']);
+ expect(newframe.columns()).to.deep.equal(['a', 'b', 'c']);
+ });
+ });
+ describe('Update a frame and column names', () => {
+ it('should update a frame', () => {
+ const newframe = new Izuku([
+ ['a', 'b', 'c'],
+ ['d', 'e', 'f'],
+ ['g', 'h', 'i']
+ ]);
+ newframe.columns(['a', 'b', 'c']);
+ expect(newframe.frame()).to.deep.equal([
+ ['a', 'b', 'c'],
+ ['d', 'e', 'f'],
+ ['g', 'h', 'i']
+ ]);
+ expect(newframe.columns()).to.deep.equal(['a', 'b', 'c']);
+ newframe.frame([
+ ['j', 'k', 'l'],
+ ['m', 'n', 'o'],
+ ['p', 'q', 'r']
+ ]);
+ newframe.columns(['j', 'k', 'l']);
+ expect(newframe.frame()).to.deep.equal([
+ ['j', 'k', 'l'],
+ ['m', 'n', 'o'],
+ ['p', 'q', 'r']
+ ]);
+ expect(newframe.columns()).to.deep.equal(['j', 'k', 'l']);
+ });
+ });
+});