mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 04:08:12 +08:00
initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
var babelConfig = require('../configuration/babel/babel.test.js');
|
||||
require('babel-register')(babelConfig);
|
||||
|
||||
// Deobfuscate CSS modules classes for testing
|
||||
require('css-modules-require-hook')({ generateScopedName: '[local]' });
|
||||
|
||||
require.extensions['.svg'] = () => null;
|
||||
|
||||
var jsdom = require('jsdom').jsdom;
|
||||
|
||||
var chai = require('chai');
|
||||
var sinonChai = require('sinon-chai');
|
||||
|
||||
var exposedProperties = [ 'window', 'navigator', 'document' ];
|
||||
|
||||
global.document = jsdom('');
|
||||
global.window = document.defaultView;
|
||||
|
||||
global.expect = chai.expect;
|
||||
|
||||
chai.use(sinonChai);
|
||||
|
||||
Object.keys(document.defaultView).forEach(property => {
|
||||
if (typeof global[property] === 'undefined') {
|
||||
exposedProperties.push(property);
|
||||
global[property] = document.defaultView[property];
|
||||
}
|
||||
});
|
||||
|
||||
global.navigator = { userAgent: 'node.js' };
|
||||
|
||||
documentRef = document;
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
|
||||
import Routes from '../../src/routes';
|
||||
|
||||
describe('Routes', () => {
|
||||
it('contains spec with an expectation', () => {
|
||||
expect(shallow(<Routes />).find(Router)).to.have.length(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user