Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(infrastructure): point all tests to es6 files for accurate test coverage #198

Merged
merged 1 commit into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"stop": "./test/screenshot/stop.sh",
"build": "npm run clean && mkdirp build && webpack --config packages/webpack.config.js --progress --colors",
"capture": "MDC_COMMIT_HASH=$(git rev-parse --short HEAD) MDC_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) mocha --compilers js:babel-core/register --ui tdd --timeout 90000 test/screenshot/capture-suite.js",
"clean": "rm -rf build/** build",
"clean": "rm -rf build/** build packages/**/dist/",
"commitmsg": "validate-commit-msg",
"fix": "eslint --fix packages test",
"lint": "eslint packages test",
Expand All @@ -16,7 +16,7 @@
"posttest": "npm stop && istanbul report --root coverage text-summary && istanbul check-coverage --lines 95 --statements 95 --branches 95 --functions 95",
"postinstall": "lerna bootstrap",
"test:watch": "karma start karma.local.js --auto-watch",
"test:unit": "NODE_ENV=test karma start karma.local.js --single-run",
"test:unit": "npm run clean && NODE_ENV=test karma start karma.local.js --single-run",
"test:unit-ci": "karma start karma.ci.js --single-run",
"test:image-diff": "MDC_COMMIT_HASH=$(git rev-parse --short HEAD) MDC_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) mocha --compilers js:babel-core/register --ui tdd --timeout 90000 test/screenshot/diff-suite.js",
"test:screenshots": "docker run -it --rm --cap-add=SYS_ADMIN -e MDC_GCLOUD_SERVICE_ACCOUNT_KEY=\"${MDC_GCLOUD_SERVICE_ACCOUNT_KEY}\" mdcreact/screenshots /bin/sh -c 'git checkout master; git pull; npm i; /home/pptruser/material-components-web-react/test/screenshot/start.sh; sleep 200s; npm run test:image-diff'",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/button/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {assert} from 'chai';
import td from 'testdouble';
import {mount, shallow} from 'enzyme';
import {Button} from '../../../packages/button';
import {Button} from '../../../packages/button/index';

suite('Button');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/ActionButton.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import {CardActionButtons} from '../../../packages/card';
import {CardActionButtons} from '../../../packages/card/index';

suite('CardActionButtons');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/ActionIcons.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import {CardActionIcons} from '../../../packages/card';
import {CardActionIcons} from '../../../packages/card/index';

suite('CardActionIcons');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/Actions.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import {CardActions} from '../../../packages/card';
import {CardActions} from '../../../packages/card/index';

suite('CardActions');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/Content.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import {CardPrimaryContent} from '../../../packages/card';
import {CardPrimaryContent} from '../../../packages/card/index';

suite('CardPrimaryContent');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/Media.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import {CardMedia} from '../../../packages/card';
import {CardMedia} from '../../../packages/card/index';

suite('CardMedia');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/card/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import Card from '../../../packages/card';
import Card from '../../../packages/card/index';

suite('Card');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/chips/Chip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// import {assert} from 'chai';
// import {mount} from 'enzyme';
// import td from 'testdouble';
// import {Chip, ChipCheckmark} from '../../../packages/chips';
// import {Chip, ChipCheckmark} from '../../../packages/chips/index';
//
// suite('Chip');
//
Expand Down
2 changes: 1 addition & 1 deletion test/unit/chips/ChipSet.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import React from 'react';
// import {assert} from 'chai';
// import {shallow} from 'enzyme';
// import {Chip, ChipSet} from '../../../packages/chips';
// import {Chip, ChipSet} from '../../../packages/chips/index';
//
// suite('ChipSet');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/fab/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {mount} from 'enzyme'; // need mount for ripple ref call
import Fab from '../../../packages/fab';
import Fab from '../../../packages/fab/index';

suite('Fab');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/floating-label/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {mount, shallow} from 'enzyme';
import FloatingLabel from '../../../packages/floating-label';
import FloatingLabel from '../../../packages/floating-label/index';

suite('Floating Label');

Expand Down
3 changes: 1 addition & 2 deletions test/unit/line-ripple/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import LineRipple from '../../../packages/line-ripple';
import LineRipple from '../../../packages/line-ripple/index';

suite('LineRipple');

Expand Down Expand Up @@ -108,4 +108,3 @@ test('#adapter.setStyle updates style names to camel case', () => {
assert.equal(wrapper.state().style.transformOrigin, 25);
assert.equal(wrapper.state().style['transform-origin'], undefined);
});

2 changes: 1 addition & 1 deletion test/unit/material-icon/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {assert} from 'chai';
import {mount} from 'enzyme';
import MaterialIcon, {RippleMaterialIcon} from '../../../packages/material-icon';
import MaterialIcon, {RippleMaterialIcon} from '../../../packages/material-icon/index';

suite('MaterialIcon');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/notched-outline/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {assert} from 'chai';
import td from 'testdouble';
import {mount, shallow} from 'enzyme';
import NotchedOutline from '../../../packages/notched-outline';
import NotchedOutline from '../../../packages/notched-outline/index';

suite('NotchedOutline');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/ripple/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {assert} from 'chai';
import td from 'testdouble';
// must use mount for refs to work
import {mount} from 'enzyme';
import withRipple from '../../../packages/ripple';
import withRipple from '../../../packages/ripple/index';
import {createMockRaf} from '../helpers/raf';

/*eslint-disable */
Expand Down
2 changes: 1 addition & 1 deletion test/unit/text-field/Input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {mount, shallow} from 'enzyme';
import {Input} from '../../../packages/text-field';
import {Input} from '../../../packages/text-field/index';

suite('Text Field Input');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/text-field/helper-text/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import HelperText from '../../../../packages/text-field/helper-text';
import HelperText from '../../../../packages/text-field/helper-text/index';

suite('Text Field Helper Text');

Expand Down
4 changes: 2 additions & 2 deletions test/unit/text-field/icon/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import Icon from '../../../../packages/text-field/icon';
import MaterialIcon from '../../../../packages/material-icon';
import Icon from '../../../../packages/text-field/icon/index';
import MaterialIcon from '../../../../packages/material-icon/index';

suite('Text Field Icon');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/text-field/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import td from 'testdouble';
import {assert} from 'chai';
import {mount, shallow} from 'enzyme';
import TextField, {HelperText, Input} from '../../../packages/text-field';
import TextField, {HelperText, Input} from '../../../packages/text-field/index';

suite('Text Field');

Expand Down
4 changes: 2 additions & 2 deletions test/unit/top-app-bar/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import {assert} from 'chai';
import {mount, shallow} from 'enzyme';
import td from 'testdouble';
import TopAppBar from '../../../packages/top-app-bar';
import withRipple from '../../../packages/ripple';
import TopAppBar from '../../../packages/top-app-bar/index';
import withRipple from '../../../packages/ripple/index';

suite('TopAppBar');

Expand Down