Skip to content

Commit ac08ea1

Browse files
committed
Adds the standard mock version of the module
1 parent c8d0c3c commit ac08ea1

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

docs/server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ the native NodeJS server that exposes ExpressJS to the outside world.
2525

2626
For the practical use, staring the server is as easy as:
2727
```js
28-
import serverFactory from 'topcoder-react-utils/dist/server`;
28+
import serverFactory from 'topcoder-react-utils/dist/src/server`;
2929
import webpackConfig from 'config/webpack/production.js`;
3030
3131
const options = {}; // A number of extra options can be provided here.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
"url": "git+https://github.com/topcoder-platform/topcoder-react-utils.git"
9797
},
9898
"scripts": {
99-
"build": "npm run clean && ./node_modules/.bin/webpack --env=production --colors --display-optimization-bailout --profile --progress && BABEL_END=production babel src --out-dir dist/server-side",
100-
"build:dev": "npm run clean && (./node_modules/.bin/webpack --env=development --bail --colors --display-optimization-bailout --profile --progress --watch | BABEL_ENV=development babel src --out-dir dist/server-side --watch)",
99+
"build": "npm run clean && ./node_modules/.bin/webpack --env=production --colors --display-optimization-bailout --profile --progress && BABEL_END=production babel src --out-dir dist/src",
100+
"build:dev": "npm run clean && (./node_modules/.bin/webpack --env=development --bail --colors --display-optimization-bailout --profile --progress --watch | BABEL_ENV=development babel src --out-dir dist/src --watch)",
101101
"clean": "rm -rf dist",
102102
"jest": "jest --no-cache --maxWorkers=4 --config config/jest/default.js",
103103
"lint": "npm run lint:js && npm run lint:scss",
@@ -106,5 +106,5 @@
106106
"prepublishOnly": "npm run build",
107107
"test": "npm run lint && npm run jest"
108108
},
109-
"version": "0.2.4"
109+
"version": "0.2.5"
110110
}

src/mock.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const mock = require('./index');
2+
mock.utils = require('./shared/__mocks__/utils').default;
3+
4+
module.exports = mock;

src/shared/__mocks__/utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import mock from '../utils';
2+
import isomorphy from '../utils/__mocks__/isomorphy';
3+
4+
mock.isomorphy = isomorphy;
5+
6+
export default mock;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Mockup of the isomorphy module.
3+
*/
4+
5+
const mock = require.requireActual('../isomorphy');
6+
7+
mock.buildTimestamp = () => 'Wed, 29 Nov 2017 07:40:00 GMT';
8+
9+
export default mock;

0 commit comments

Comments
 (0)