Skip to content

Commit

Permalink
Renamed jest config files to more understandable names
Browse files Browse the repository at this point in the history
  • Loading branch information
yTakkar committed Jun 23, 2018
1 parent 112bd5d commit 2882455
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
6 changes: 0 additions & 6 deletions enzyme.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ require('dotenv').config()
const { PORT } = process.env

module.exports = {
setupFiles: ['<rootDir>/enzyme.config.js'],
setupTestFrameworkScriptFile: '<rootDir>/jest.setup.js',
setupFiles: ['<rootDir>/jest.setup.js'],
setupTestFrameworkScriptFile: '<rootDir>/jest.setupScriptFile.js',
testURL: `http://localhost:${PORT}`,
watchPlugins: [
'jest-watch-typeahead/filename',
Expand Down
9 changes: 5 additions & 4 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// import jest-extended
import 'jest-extended'
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'

// set timeout (jest default=5000ms)
jest.setTimeout(30000)
configure({
adapter: new Adapter()
})
5 changes: 5 additions & 0 deletions jest.setupScriptFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// import jest-extended
import 'jest-extended'

// set timeout (jest default=5000ms)
jest.setTimeout(30000)
62 changes: 31 additions & 31 deletions src/components/others/link/__test__/link.test.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React from 'react'
import { create } from 'react-test-renderer'
import AppLink from '../link'
import { BrowserRouter as Router } from 'react-router-dom'

describe('AppLink Component', () => {

it('should match snapshot with label as a string', () => {
const tree = create(
<Router>
<AppLink
to='/'
label='Home'
/>
</Router>
).toJSON()
expect(tree).toMatchSnapshot()
})

it('should match snapshot with children prop', () => {
const tree = create(
<Router>
<AppLink to='/' >
<img src='/images/spacecraft.jpg' />
</AppLink>
</Router>
).toJSON()
expect(tree).toMatchSnapshot()
})

})
import React from 'react'
import { create } from 'react-test-renderer'
import AppLink from '../link'
import { BrowserRouter as Router } from 'react-router-dom'

describe('AppLink Component', () => {

it('should match snapshot with label as a string', () => {
const tree = create(
<Router>
<AppLink
to='/'
label='Home'
/>
</Router>
).toJSON()
expect(tree).toMatchSnapshot()
})

it('should match snapshot with children prop', () => {
const tree = create(
<Router>
<AppLink to='/' >
<img src='/images/spacecraft.jpg' />
</AppLink>
</Router>
).toJSON()
expect(tree).toMatchSnapshot()
})

})

0 comments on commit 2882455

Please sign in to comment.