-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
772 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
dist/** | ||
test/** | ||
node_modules/* | ||
package.json | ||
webpack.*.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const path = require('path'); | ||
const path = require('path') | ||
|
||
// This is a custom Jest transformer turning file imports into filenames. | ||
// http://facebook.github.io/jest/docs/tutorial-webpack.html | ||
|
||
module.exports = { | ||
process(src, filename) { | ||
// eslint-disable-next-line prefer-template | ||
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';'; | ||
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';' | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import jsdom from 'jsdom'; | ||
import sinon from 'sinon'; | ||
import Enzyme from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import '@babel/polyfill'; | ||
import jsdom from 'jsdom' | ||
import sinon from 'sinon' | ||
import Enzyme from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import '@babel/polyfill' | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
Enzyme.configure({ adapter: new Adapter() }) | ||
|
||
// localStorage | ||
class LocalStorageMock { | ||
constructor() { | ||
this.store = {}; | ||
this.store = {} | ||
} | ||
|
||
clear() { | ||
this.store = {}; | ||
this.store = {} | ||
} | ||
|
||
getItem(key) { | ||
return this.store[key]; | ||
return this.store[key] | ||
} | ||
|
||
setItem(key, value) { | ||
this.store[key] = value.toString(); | ||
this.store[key] = value.toString() | ||
} | ||
} | ||
|
||
window.localStorage = new LocalStorageMock(); | ||
window.__SERVER__ = false; | ||
window.__DEVELOPMENT__ = false; | ||
window.localStorage = new LocalStorageMock() | ||
window.__SERVER__ = false | ||
window.__DEVELOPMENT__ = false | ||
|
||
// Define some html to be our basic document | ||
// JSDOM will consume this and act as if we were in a browser | ||
const DEFAULT_HTML = '<!doctype html><html><body></body></html>'; | ||
const DEFAULT_HTML = '<!doctype html><html><body></body></html>' | ||
|
||
// Define some variables to make it look like we're a browser | ||
// First, use JSDOM's fake DOM as the document | ||
global.document = jsdom.jsdom(DEFAULT_HTML); | ||
global.document = jsdom.jsdom(DEFAULT_HTML) | ||
|
||
// Set up a mock window | ||
global.window = document.defaultView; | ||
global.window = document.defaultView | ||
|
||
// Allow for things like window.location | ||
global.navigator = window.navigator; | ||
global.navigator = window.navigator | ||
|
||
global.XMLHttpRequest = sinon.useFakeXMLHttpRequest(); | ||
global.XMLHttpRequest = sinon.useFakeXMLHttpRequest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/* global jasmine:false */ | ||
|
||
if (process.env.CI) { | ||
const jasmineReporters = require('jasmine-reporters'); // eslint-disable-line global-require | ||
const jasmineReporters = require('jasmine-reporters') // eslint-disable-line global-require | ||
const junitReporter = new jasmineReporters.JUnitXmlReporter({ | ||
savePath: 'testresults', | ||
consolidateAll: false, | ||
}); | ||
}) | ||
|
||
jasmine.getEnv().addReporter(junitReporter); | ||
jasmine.getEnv().addReporter(junitReporter) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const babelJest = require('babel-jest'); | ||
const babelJest = require('babel-jest') | ||
|
||
module.exports = babelJest.createTransformer(); | ||
module.exports = babelJest.createTransformer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.