1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

webui: tests and dependency mock fixes

deps fixes

deps fixes
This commit is contained in:
Ayush Sharma 2017-12-03 15:44:17 +05:30 committed by juanpicado
parent ab4b9a0e2e
commit d24904c650
7 changed files with 11 additions and 28 deletions

@ -26,12 +26,10 @@
]
},
"test": {
"presets": [ "es2015-node4", "es2015", "flow", "react"],
"presets": [ "es2015-node4", "flow", "react"],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread",
"transform-class-properties",
"syntax-async-functions"
"transform-object-rest-spread"
]
},
"registry": {

@ -22,9 +22,7 @@ module.exports = {
'moduleNameMapper': {
'\\.(scss)$': '<rootDir>/node_modules/identity-obj-proxy',
'github-markdown-css': '<rootDir>/node_modules/identity-obj-proxy',
'\\.(png)$': '<rootDir>/node_modules/identity-obj-proxy',
'api': '<rootDir>/test/webui/components/__mocks__/api.js',
'storage': '<rootDir>/test/webui/components/__mocks__/storage.js',
'\\.(png)$': '<rootDir>/node_modules/identity-obj-proxy'
},
'transformIgnorePatterns': [
'<rootDir>/node_modules/(?!react-syntax-highlighter)'

@ -56,7 +56,6 @@
"babel-jest": "^21.2.0",
"babel-loader": "7.1.2",
"babel-plugin-flow-runtime": "0.15.0",
"babel-plugin-syntax-async-functions": "^6.13.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "1.3.4",
@ -77,8 +76,8 @@
"css-loader": "0.28.7",
"element-react": "1.4.3",
"element-theme-default": "1.4.12",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"eslint": "4.2.0",
"eslint-config-google": "0.9.1",
"eslint-loader": "1.9.0",

@ -1,17 +0,0 @@
/**
* Storage mock
*/
const store = {};
const storage = {
setItem: (key, value) => {
store[key] = value;
return store;
},
getItem: key => {
return store[key];
}
};
export default storage;

@ -7,6 +7,11 @@ import Header from '../../../src/webui/src/components/Header';
import { BrowserRouter } from 'react-router-dom';
import storage from '../../../src/webui/utils/storage';
jest.mock('../../../src/webui/utils/api', () => ({
get: require('./__mocks__/api').default.get,
post: require('./__mocks__/api').default.post
}));
describe('<Header /> component shallow', () => {
let wrapper;

@ -1,6 +1,6 @@
/**
* Setup configuration for Jest
* This file includes gloabl settings for the JEST environment.
* This file includes global settings for the JEST environment.
*/
import 'raf/polyfill';
import { configure } from 'enzyme';

BIN
yarn.lock

Binary file not shown.