Skip to content

Commit

Permalink
Tests updates
Browse files Browse the repository at this point in the history
  • Loading branch information
asabhaney committed Apr 4, 2018
1 parent 8b9a68c commit 6cbb6f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build": "rm -rf dist && webpack",
"dev": "node server.js",
"demo": "node server.js",
"test": "mocha --compilers js:babel-core/register --recursive test/test.js",
"test:watch": "mocha --compilers js:babel-core/register --recursive test/test.js --watch --reporter min",
"test": "mocha --require @babel/register --recursive test/test.js",
"test:watch": "mocha --require @babel/register --recursive test/test.js --watch --reporter min",
"webpack-analyze": "mkdir -p .tmp; NODE_ENV=production webpack --config webpack.config.js --profile --json > .tmp/stats.json; webpack-bundle-analyzer .tmp/stats.json"
},
"files": [
Expand All @@ -33,17 +33,22 @@
"url": "https://github.com/mother/react-files/issues"
},
"homepage": "https://github.com/mother/react-files",
"peerDependencies": {
"react": "^15.0.0"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.44",
"@babel/preset-env": "7.0.0-beta.44",
"@babel/preset-react": "7.0.0-beta.44",
"@babel/preset-stage-0": "7.0.0-beta.44",
"@babel/register": "7.0.0-beta.44",
"axios": "0.16.2",
"@babel/core": "7.0.0-beta.43",
"@babel/preset-env": "7.0.0-beta.43",
"@babel/preset-react": "7.0.0-beta.43",
"@babel/preset-stage-0": "7.0.0-beta.43",
"babel-eslint": "7.1.1",
"babel-loader": "8.0.0-beta.2",
"blob": "0.0.4",
"chai": "3.5.0",
"enzyme": "2.4.1",
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "1.1.1",
"eslint": "3.4.0",
"eslint-config-standard": "6.0.0",
"eslint-config-standard-react": "4.0.0",
Expand All @@ -53,11 +58,10 @@
"express": "4.15.4",
"form-data": "2.3.1",
"jsdom": "9.4.2",
"mocha": "3.0.2",
"mocha": "5.0.5",
"multer": "1.3.0",
"prop-types": "15.6.1",
"react": "16.2.0",
"react-addons-test-utils": "15.3.1",
"react-dom": "16.2.0",
"webpack": "4.4.1",
"webpack-bundle-analyzer": "2.11.1",
Expand Down
10 changes: 6 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react'
import { mount } from 'enzyme'
import Enzyme, { mount } from 'enzyme'
import EnzymeAdapter from 'enzyme-adapter-react-16'
import { expect } from 'chai'
import { describe, it } from 'mocha'
import Files from '../src'

Enzyme.configure({ adapter: new EnzymeAdapter() })

// Add DOM environment
import jsdom from 'jsdom'
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>')
global.document = doc
global.window = doc.defaultView

import Files from '../src/Files'

describe('<Files />', () => {
it('allows us to set props', () => {
const wrapper = mount(<Files bar='baz' />)
Expand All @@ -32,7 +34,7 @@ describe('<Files />', () => {

it('allows us to set a class name', () => {
const wrapper = mount(<Files className='files-dropzone' />)
expect(wrapper.find('.files-dropzone').hasClass('files-dropzone')).to.equal(true)
expect(wrapper.find('div.files-dropzone')).to.have.length(1)
})

it('allows us to set the "dropActiveClassName" prop', () => {
Expand Down

0 comments on commit 6cbb6f0

Please sign in to comment.