Adding tests.

This commit is contained in:
Matt Swensen 2016-12-03 14:52:22 -07:00
parent 2a94dcaca8
commit d497eda5dc
3 changed files with 1232 additions and 27 deletions

@ -9,14 +9,19 @@
"type": "git" "type": "git"
}, },
"license": "MIT", "license": "MIT",
"jest": {
"rootDir": "lib"
},
"scripts": { "scripts": {
"build": "babel --out-dir lib src", "build": "babel --out-dir lib src",
"start": "watch 'yarn run build' src", "start": "watch 'yarn run build' src",
"prepublish": "yarn run build" "prepublish": "yarn run build",
"test": "yarn run build; jest"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.18.0", "babel-cli": "^6.18.0",
"babel-preset-latest": "^6.16.0", "babel-preset-latest": "^6.16.0",
"jest": "^17.0.3",
"watch": "^1.0.1" "watch": "^1.0.1"
}, },
"peerDependencies": { "peerDependencies": {

20
src/index.spec.js Normal file

@ -0,0 +1,20 @@
import { colors } from './index';
describe('themer default colors', () => {
it('should contain both a light and a dark theme', () => {
expect(colors.light).toBeDefined();
expect(colors.dark).toBeDefined();
});
it('should define all 16 required colors for each theme', () => {
const prefixes = [ 'accent', 'shade' ];
prefixes.forEach(prefix => {
for (let i = 0; i <= 7; i++) {
expect(colors.light[`${prefix}${i}`]).toBeDefined();
expect(colors.dark[`${prefix}${i}`]).toBeDefined();
}
});
});
});

1232
yarn.lock

File diff suppressed because it is too large Load Diff