Skip to content

Instantly share code, notes, and snippets.

View ollelauribostrom's full-sized avatar

Olle Lauri Boström ollelauribostrom

View GitHub Profile
This file has been truncated, but you can view the full file.
➜ gatsby git:(mutation) ✗ yarn test:mutate babel-preset-gatsby-package
yarn run v1.12.3
$ node scripts/mutate.js babel-preset-gatsby-package
-> package: babel-preset-gatsby-package
Found 1 file to mutate.
14:13:59 (3703) INFO ConfigReader No config file specified. Running with command line arguments.
14:13:59 (3703) INFO ConfigReader Use `stryker init` command to generate your config file.
14:13:59 (3703) DEBUG PluginLoader Loading @stryker-mutator/* from /Users/ollelauribostrom/Desktop/Sommar/gatsby/node_modules/@stryker-mutator
14:13:59 (3703) DEBUG PluginLoader Loading plugin "/Users/ollelauribostrom/Desktop/Sommar/gatsby/node_modules/@stryker-mutator/babel-transpiler" (matched with expression @stryker-mutator/*)
sudo: false
language: node_js
node_js:
- '8'
branches:
only:
- master
cache:
directories:
- node_modules
"scripts": {
"coveralls": "jest --coverage && cat ./tests/coverage/lcov.info | coveralls",
},
async function init() {
await import(/* webpackChunkName: "monaco-editor" */ "monaco-editor");
ReactDOM.render(<App />, document.getElementById("app"));
await import(/* webpackChunkName: "monaco-languages" */ "monaco-editor");
await registerLanguages();
}
optimization: {
splitChunks: {
cacheGroups: {
editor: {
// Editor bundle
test: /[\\/]node_modules\/(monaco-editor\/esm\/vs\/(nls\.js|editor|platform|base|basic-languages|language\/(css|html|json|typescript)\/monaco\.contribution\.js)|style-loader\/lib|css-loader\/lib\/css-base\.js)/,
name: "monaco-editor",
chunks: "async"
},
languages: {
import inRange from '../src/inRange';
describe('{unit}: Testing inRange', () => {
it('should return true if in range', () => {
expect(inRange({ number: 5, low: 0, high: 10 })).toEqual(true);
});
it('should return false if not in range', () => {
expect(inRange({ number: 1, low: 5, high: 10 })).toEqual(false);
});
it('should include low value in range', () => {
import inRange from '../src/inRange';
describe('{unit}: Testing inRange', () => {
it('should return true if in range', () => {
expect(inRange({ number: 5, low: 0, high: 10 })).toEqual(true);
});
it('should return false if not in range', () => {
expect(inRange({ number: 1, low: 5, high: 10 })).toEqual(false);
});
});
function inRange({ number, low, high }) {
return number >= low && number <= high;
}
export default inRange;
function assert(condition, message) {
if (condition) {
throw new Error(message);
}
}
function assert(condition, message) {
if (!condition) {
throw new Error(message);
}
}