mirror of https://github.com/facebook/jest.git
chore: remove lint exceptions for files in `examples` folder (#13346)
This commit is contained in:
parent
aae0d3ac34
commit
c6b812da65
|
@ -216,8 +216,7 @@ module.exports = {
|
|||
{
|
||||
files: ['examples/**/*'],
|
||||
rules: {
|
||||
'import/no-unresolved': ['error', {ignore: ['^react-native$']}],
|
||||
'import/order': 'off',
|
||||
'no-restricted-imports': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||
import {describe, expect, it, jest} from '@jest/globals';
|
||||
|
||||
import {AppComponent} from './app.component';
|
||||
import {DataService} from './shared/data.service';
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component} from '@angular/core';
|
||||
|
||||
import {DataService} from './shared/data.service';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {AppComponent} from './app.component';
|
||||
|
||||
@NgModule({
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {TestBed} from '@angular/core/testing';
|
||||
import {beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||
|
||||
import {DataService} from './data.service';
|
||||
import {SubService} from './sub.service';
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
|
||||
import {SubService} from './sub.service';
|
||||
|
||||
@Injectable()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {TestBed} from '@angular/core/testing';
|
||||
import {beforeEach, describe, expect, it} from '@jest/globals';
|
||||
|
||||
import {SubService} from './sub.service';
|
||||
|
||||
describe('Service: SubService', () => {
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
import Enzyme, {shallow} from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
import CheckboxWithLabel from '../CheckboxWithLabel';
|
||||
|
||||
Enzyme.configure({adapter: new Adapter()});
|
||||
|
||||
import CheckboxWithLabel from '../CheckboxWithLabel';
|
||||
|
||||
it('CheckboxWithLabel changes the text after click', () => {
|
||||
// Render a checkbox with label in the document
|
||||
const checkbox = shallow(<CheckboxWithLabel labelOn="On" labelOff="Off" />);
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
// mongo-environment.js
|
||||
const NodeEnvironment = require('jest-environment-node').default;
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const fs = require('fs');
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import NodeEnvironment from 'jest-environment-node';
|
||||
|
||||
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
// setup.js
|
||||
const path = require('path');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const {MongoMemoryServer} = require('mongodb-memory-server');
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {MongoMemoryServer} from 'mongodb-memory-server';
|
||||
|
||||
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
// teardown.js
|
||||
const path = require('path');
|
||||
|
||||
const fs = require('fs');
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
import Intro from './Intro';
|
||||
import React, {Component} from 'react';
|
||||
import {AppRegistry} from 'react-native';
|
||||
import Intro from './Intro';
|
||||
|
||||
class App extends Component<{}> {
|
||||
render() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
import {createRef} from 'react';
|
||||
|
||||
import * as TestUtils from 'react-dom/test-utils';
|
||||
import CheckboxWithLabel from '../CheckboxWithLabel';
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import Clock from '../Clock';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Clock from '../Clock';
|
||||
|
||||
jest.useFakeTimers();
|
||||
Date.now = jest.fn(() => 1482363367071);
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import Link from '../Link';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Link from '../Link';
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import * as TestUtils from 'react-dom/test-utils';
|
||||
|
||||
const CheckboxWithLabel = require('../CheckboxWithLabel').default;
|
||||
|
||||
it('CheckboxWithLabel changes the text after click', () => {
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
||||
|
||||
import {jest} from '@jest/globals';
|
||||
|
||||
import Memory from '../memory';
|
||||
import Memory from '../Memory';
|
||||
import makeCalc from '../calc';
|
||||
import sub from '../sub';
|
||||
import sum from '../sum';
|
||||
import makeCalc from '../calc';
|
||||
|
||||
jest.mock('../memory');
|
||||
jest.mock('../Memory');
|
||||
jest.mock('../sub');
|
||||
jest.mock('../sum');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Memory from './Memory';
|
||||
import sub from './sub';
|
||||
import sum from './sum';
|
||||
import Memory from './memory';
|
||||
|
||||
type Op = 'MemoryAdd' | 'MemoryClear' | 'MemorySub' | 'Sub' | 'Sum';
|
||||
|
||||
|
|
Loading…
Reference in New Issue