Skip to content

Commit

Permalink
chore(eslint): upgrade eslint to ^4.18.2
Browse files Browse the repository at this point in the history
eslint has a security hole patched in 4.18.2 (link: eslint/eslint@f6901d0), this upgrade threw a warning around requires in the test files. I chose to suppress the warnings and accept the require as nessesary, if the maintainers would rather have the warning print during lint/build execution, I can remove the suppressions.
  • Loading branch information
tklever committed Sep 25, 2019
1 parent af2e29a commit f84860c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions __tests__/html-report-creator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function setupTest() {
fs.writeFileSync = jest.fn();
process.cwd = jest.fn(() => '/path/to/something');

// eslint-disable-next-line global-require
return require('../html-report-creator');
}

Expand Down
3 changes: 3 additions & 0 deletions __tests__/jest-preset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('jest-preset.js', () => {
});

it('should produce valid jest preset config', () => {
// eslint-disable-next-line global-require
const jestPreset = require('../jest-preset');

expect(jestPreset).toMatchObject({
Expand Down Expand Up @@ -55,13 +56,15 @@ describe('jest-preset.js', () => {

it('should disable jest cache if running on CI server', () => {
jest.doMock('is-ci', () => true);
// eslint-disable-next-line global-require
const jestPreset = require('../jest-preset');

expect(jestPreset).toHaveProperty('cache', false);
});

it('should enable jest cache if running outside of a CI server', () => {
jest.doMock('is-ci', () => false);
// eslint-disable-next-line global-require
const jestPreset = require('../jest-preset');

expect(jestPreset).toHaveProperty('cache', true);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"amex-jest-preset": ".",
"eslint": "^3.19.0",
"eslint": "^4.18.2",
"eslint-config-amex": "^6.0.0",
"githook-scripts": "^1.0.1",
"jest": "^23.0.2",
Expand Down

0 comments on commit f84860c

Please sign in to comment.