Skip to content

Commit

Permalink
Add simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fippli committed Feb 20, 2020
1 parent 7474efb commit d53620d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "@codewell/state-persistor",
"version": "1.0.0",
"description": "State persistor for front end applications",
"main": "src/index.js",
"main": "index.js",
"scripts": {
"test": "jest",
"test": "npm run release && jest",
"build": "rollup --config",
"release": "npm run build:dev && npm run build:prod",
"build:prod": "NODE_ENV=production rollup -c",
Expand Down
26 changes: 26 additions & 0 deletions tests/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const devLib = require("../lib/dev");
const prodLib = require("../lib/dev");

test("That dev lib has saveState", () => {
expect(typeof devLib.saveState).toBe("function");
});

test("That dev lib has loadState", () => {
expect(typeof devLib.loadState).toBe("function");
});

test("That dev lib has purgeState", () => {
expect(typeof devLib.purgeState).toBe("function");
});

test("That prod lib has saveState", () => {
expect(typeof prodLib.saveState).toBe("function");
});

test("That prod lib has loadState", () => {
expect(typeof prodLib.loadState).toBe("function");
});

test("That prod lib has purgeState", () => {
expect(typeof prodLib.purgeState).toBe("function");
});

0 comments on commit d53620d

Please sign in to comment.