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

build(jest): Upgrade jest to 24.8.0 #14311

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -132,16 +132,16 @@
"@typescript-eslint/parser": "^1.11.0",
"babel-eslint": "^10.0.1",
"babel-gettext-extractor": "^4.1.3",
"babel-jest": "24.1.0",
"babel-jest": "24.8.0",
"babel-plugin-dynamic-import-node": "^2.2.0",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"enzyme-to-json": "3.4.0",
"eslint": "5.11.1",
"eslint-config-sentry-app": "1.14.0",
"jest": "24.1.0",
"jest": "24.8.0",
"jest-canvas-mock": "^2.1.0",
"jest-junit": "^3.4.1",
"jest-junit": "^7.0.0",
"mockdate": "2.0.2",
"object.fromentries": "^2.0.0",
"prettier": "1.16.4",
Expand All @@ -163,7 +163,7 @@
"scripts": {
"test": "node scripts/test.js",
"test-precommit": "yarn test --bail --findRelatedTests -u",
"test-ci": "JEST_JUNIT_OUTPUT=.artifacts/jest.junit.xml yarn test --ci --coverage --testResultsProcessor=jest-junit",
"test-ci": "JEST_JUNIT_OUTPUT=.artifacts/jest.junit.xml yarn test --ci --coverage --reporters=default --reporters=jest-junit",
"test-debug": "node --inspect-brk scripts/test.js --runInBand",
"test-staged": "yarn test --findRelatedTests $(git diff --name-only --cached)",
"lint": "node_modules/.bin/eslint tests/js src/sentry/static/sentry/app --ext .js,.jsx,.ts,.tsx",
Expand Down
@@ -1,7 +1,6 @@
import {Flex} from 'grid-emotion';
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';
import styled from 'react-emotion';

import {DEFAULT_STATS_PERIOD} from 'app/constants';
Expand Down Expand Up @@ -413,7 +412,8 @@ const Menu = styled('div')`
overflow: hidden;
`;

const SelectorList = styled(({isAbsoluteSelected, ...props}) => <Flex {...props} />)`
const SelectorList = styled('div')`
display: flex;
flex: 1;
flex-direction: column;
flex-shrink: 0;
Expand Down
13 changes: 7 additions & 6 deletions tests/js/spec/components/charts/chartZoom.spec.jsx
Expand Up @@ -2,7 +2,12 @@ import React from 'react';

import {mount} from 'enzyme';
import ChartZoom from 'app/components/charts/chartZoom';
import ConfigStore from 'app/stores/configStore';

jest.mock('moment', () => {
const moment = require.requireActual('moment-timezone');
moment.tz.setDefault('America/Los_Angeles'); // Whatever timezone you want
return moment;
});

describe('ChartZoom', function() {
const renderFunc = jest.fn(() => null);
Expand All @@ -11,11 +16,7 @@ describe('ChartZoom', function() {
let tooltipFormatter;
const timestamp = 1531094400000;

beforeAll(function() {
ConfigStore.loadInitialData({
user: {options: {timezone: 'America/Los_Angeles'}},
});
});
beforeAll(function() {});

beforeEach(function() {
renderFunc.mockClear();
Expand Down