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