Adding tests.
This commit is contained in:
parent
2a94dcaca8
commit
d497eda5dc
@ -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
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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user