Skip to content

Commit

Permalink
refactor global loader shim
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Jul 31, 2018
1 parent f6678d8 commit 8aa0583
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 24 deletions.
5 changes: 5 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"verbose": true,

"globals": {
"__PATH_PREFIX__": ""
},

"setupFiles": [
"<rootDir>/test/loader-shim.js",
"raf/polyfill"
],

Expand Down
4 changes: 0 additions & 4 deletions src/components/header/header.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ configure({ adapter: new Adapter() });
describe('Header Component', () => {
let header;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
header = mount(
<MemoryRouter>
Expand Down
4 changes: 0 additions & 4 deletions src/components/navigation/navigation.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ configure({ adapter: new Adapter() });
describe('Navigation Component', () => {
const navLength = 3;
let navigation;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
navigation = mount(
Expand Down
4 changes: 0 additions & 4 deletions test/integration/pages/about.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ configure({ adapter: new Adapter() });

describe('About Page', () => {
let about;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
about = mount(
Expand Down
4 changes: 0 additions & 4 deletions test/integration/pages/blog.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ configure({ adapter: new Adapter() });
describe('BlogPage', () => {
let blog;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
blog = mount(
<MemoryRouter>
Expand Down
4 changes: 0 additions & 4 deletions test/integration/pages/index.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ configure({ adapter: new Adapter() });
describe('Home Page', () => {
let home;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
home = mount(
<MemoryRouter>
Expand Down
4 changes: 0 additions & 4 deletions test/integration/pages/projects.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ configure({ adapter: new Adapter() });
describe('Projects Page', () => {
let about;

global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

beforeEach(() => {
about = mount(
<MemoryRouter>
Expand Down
3 changes: 3 additions & 0 deletions test/loader-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global.___loader = { // eslint-disable-line no-underscore-dangle
enqueue: jest.fn()
};

0 comments on commit 8aa0583

Please sign in to comment.