Skip to content

Commit 583e7af

Browse files
swallow errors instead
1 parent 2a76768 commit 583e7af

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"size:why": "size-limit --why packages/material-ui/build/index.js",
3434
"start": "yarn docs:dev",
3535
"test": "yarn lint && yarn typescript && yarn test:coverage",
36-
"test:coverage": "cross-env INTERNAL=true NODE_ENV=test BABEL_ENV=coverage nyc mocha 'packages/**/*.test.js' 'docs/**/*.test.js' --exclude '**/node_modules/**' && nyc report -r lcovonly",
37-
"test:coverage:html": "cross-env INTERNAL=true NODE_ENV=test BABEL_ENV=coverage nyc mocha 'packages/**/**/*.test.js' --exclude '**/node_modules/**' && nyc report --reporter=html",
38-
"test:karma": "cross-env INTERNAL=true NODE_ENV=test karma start test/karma.conf.js",
36+
"test:coverage": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc mocha 'packages/**/*.test.js' 'docs/**/*.test.js' --exclude '**/node_modules/**' && nyc report -r lcovonly",
37+
"test:coverage:html": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc mocha 'packages/**/**/*.test.js' --exclude '**/node_modules/**' && nyc report --reporter=html",
38+
"test:karma": "cross-env NODE_ENV=test karma start test/karma.conf.js",
3939
"test:regressions": "yarn test:regressions:build && rimraf test/regressions/screenshots/chrome/* && vrtest run --config test/vrtest.config.js --record",
4040
"test:regressions:build": "webpack --config test/regressions/webpack.config.js",
4141
"test:umd": "node packages/material-ui/test/umd/run.js",
42-
"test:unit": "cross-env INTERNAL=true NODE_ENV=test mocha 'packages/**/*.test.js' 'docs/**/*.test.js' 'scripts/**/*.test.js' --exclude '**/node_modules/**'",
42+
"test:unit": "cross-env NODE_ENV=test mocha 'packages/**/*.test.js' 'docs/**/*.test.js' 'scripts/**/*.test.js' --exclude '**/node_modules/**'",
4343
"test:watch": "yarn test:unit --watch",
4444
"typescript": "lerna run --no-bail --parallel typescript"
4545
},

packages/material-ui/src/RootRef/RootRef.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RootRef extends React.Component {
6666

6767
render() {
6868
if (process.env.NODE_ENV !== 'production') {
69-
if (!warnedOnce && process.env.INTERNAL !== 'true') {
69+
if (!warnedOnce) {
7070
warnedOnce = true;
7171
console.warn(
7272
[

packages/material-ui/src/RootRef/RootRef.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import { expect } from 'chai';
44
import { spy } from 'sinon';
5+
import { consoleWarnMock } from 'test/utils/consoleErrorMock';
56
import createMount from 'test/utils/createMount';
67
import RootRef from './RootRef';
78

@@ -11,6 +12,15 @@ describe('<RootRef />', () => {
1112
// StrictModeViolation: uses findDOMNode
1213
const mount = createMount({ strict: false });
1314

15+
beforeEach(() => {
16+
PropTypes.resetWarningCache();
17+
consoleWarnMock.spy();
18+
});
19+
20+
afterEach(() => {
21+
consoleWarnMock.reset();
22+
});
23+
1424
it('call rootRef function on mount and unmount', () => {
1525
const rootRef = spy();
1626
const wrapper = mount(

test/karma.conf.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ module.exports = function setKarmaConfig(config) {
5555
'process.env': {
5656
NODE_ENV: JSON.stringify('test'),
5757
CI: JSON.stringify(process.env.CI),
58-
INTERNAL: JSON.stringify(process.env.INTERNAL),
5958
},
6059
}),
6160
],

0 commit comments

Comments
 (0)