Skip to content

Commit 3fb944b

Browse files
motiz88facebook-github-bot
authored andcommitted
Roll out jest/consistent-test-it rule
Summary: X-link: facebook/relay#4352 Changelog: [Internal] drop-conflicts Reviewed By: javache Differential Revision: D46838374 fbshipit-source-id: b161e9ef4e3ba3c32fbaa5b4d1a5d84596dd26c6
1 parent 5d4511a commit 3fb944b

File tree

186 files changed

+1540
-1540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+1540
-1540
lines changed

packages/babel-plugin-codegen/__tests__/index-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ describe('Babel plugin inline view configs', () => {
2828
Object.keys(fixtures)
2929
.sort()
3030
.forEach(fixtureName => {
31-
it(`can inline config for ${fixtureName}`, () => {
31+
test(`can inline config for ${fixtureName}`, () => {
3232
expect(transform(fixtures[fixtureName], fixtureName)).toMatchSnapshot();
3333
});
3434
});
3535

3636
Object.keys(failures)
3737
.sort()
3838
.forEach(fixtureName => {
39-
it(`fails on inline config for ${fixtureName}`, () => {
39+
test(`fails on inline config for ${fixtureName}`, () => {
4040
expect(() => {
4141
try {
4242
transform(failures[fixtureName], fixtureName);

packages/normalize-color/__tests__/normalizeColor-test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import normalizeColor from '..';
1515

16-
it('accepts only spec compliant colors', () => {
16+
test('accepts only spec compliant colors', () => {
1717
expect(normalizeColor('#abc')).not.toBe(null);
1818
expect(normalizeColor('#abcd')).not.toBe(null);
1919
expect(normalizeColor('#abcdef')).not.toBe(null);
@@ -29,12 +29,12 @@ it('accepts only spec compliant colors', () => {
2929
expect(normalizeColor(0xffffffff + 1)).toBe(null);
3030
});
3131

32-
it('temporarilys accept floating point values for rgb', () => {
32+
test('temporarilys accept floating point values for rgb', () => {
3333
expect(normalizeColor('rgb(1.1, 2.1, 3.1)')).toBe(0x010203ff);
3434
expect(normalizeColor('rgba(1.1, 2.1, 3.1, 1.0)')).toBe(0x010203ff);
3535
});
3636

37-
it('refuses non-spec compliant colors', () => {
37+
test('refuses non-spec compliant colors', () => {
3838
expect(normalizeColor('#00gg00')).toBe(null);
3939
expect(normalizeColor('rgb(1, 2, 3,)')).toBe(null);
4040
expect(normalizeColor('rgb(1, 2, 3')).toBe(null);
@@ -54,29 +54,29 @@ it('refuses non-spec compliant colors', () => {
5454
expect(normalizeColor('rgb(1%, 2%, 3%)')).toBe(null);
5555
});
5656

57-
it('handles hex6 properly', () => {
57+
test('handles hex6 properly', () => {
5858
expect(normalizeColor('#000000')).toBe(0x000000ff);
5959
expect(normalizeColor('#ffffff')).toBe(0xffffffff);
6060
expect(normalizeColor('#ff00ff')).toBe(0xff00ffff);
6161
expect(normalizeColor('#abcdef')).toBe(0xabcdefff);
6262
expect(normalizeColor('#012345')).toBe(0x012345ff);
6363
});
6464

65-
it('handles hex3 properly', () => {
65+
test('handles hex3 properly', () => {
6666
expect(normalizeColor('#000')).toBe(0x000000ff);
6767
expect(normalizeColor('#fff')).toBe(0xffffffff);
6868
expect(normalizeColor('#f0f')).toBe(0xff00ffff);
6969
});
7070

71-
it('handles hex8 properly', () => {
71+
test('handles hex8 properly', () => {
7272
expect(normalizeColor('#00000000')).toBe(0x00000000);
7373
expect(normalizeColor('#ffffffff')).toBe(0xffffffff);
7474
expect(normalizeColor('#ffff00ff')).toBe(0xffff00ff);
7575
expect(normalizeColor('#abcdef01')).toBe(0xabcdef01);
7676
expect(normalizeColor('#01234567')).toBe(0x01234567);
7777
});
7878

79-
it('handles rgb properly', () => {
79+
test('handles rgb properly', () => {
8080
expect(normalizeColor('rgb(0, 0, 0)')).toBe(0x000000ff);
8181
expect(normalizeColor('rgb(-1, -2, -3)')).toBe(0x000000ff);
8282
expect(normalizeColor('rgb(0, 0, 255)')).toBe(0x0000ffff);
@@ -87,7 +87,7 @@ it('handles rgb properly', () => {
8787
expect(normalizeColor('rgb(0 0 255)')).toBe(0x0000ffff);
8888
});
8989

90-
it('handles rgba properly', () => {
90+
test('handles rgba properly', () => {
9191
expect(normalizeColor('rgba(0, 0, 0, 0.0)')).toBe(0x00000000);
9292
expect(normalizeColor('rgba(0, 0, 0, 0)')).toBe(0x00000000);
9393
expect(normalizeColor('rgba(0, 0, 0, -0.5)')).toBe(0x00000000);
@@ -100,7 +100,7 @@ it('handles rgba properly', () => {
100100
expect(normalizeColor('rgba(100 15 69 / 0.5)')).toBe(0x640f4580);
101101
});
102102

103-
it('handles hsl properly', () => {
103+
test('handles hsl properly', () => {
104104
expect(normalizeColor('hsl(0, 0%, 0%)')).toBe(0x000000ff);
105105
expect(normalizeColor('hsl(360, 100%, 100%)')).toBe(0xffffffff);
106106
expect(normalizeColor('hsl(180, 50%, 50%)')).toBe(0x40bfbfff);
@@ -115,7 +115,7 @@ it('handles hsl properly', () => {
115115
expect(normalizeColor('hsl(180 50% 50%)')).toBe(0x40bfbfff);
116116
});
117117

118-
it('handles hsla properly', () => {
118+
test('handles hsla properly', () => {
119119
expect(normalizeColor('hsla(0, 0%, 0%, 0)')).toBe(0x00000000);
120120
expect(normalizeColor('hsla(360, 100%, 100%, 1)')).toBe(0xffffffff);
121121
expect(normalizeColor('hsla(360, 100%, 100%, 0)')).toBe(0xffffff00);
@@ -126,7 +126,7 @@ it('handles hsla properly', () => {
126126
expect(normalizeColor('hsla(180 50% 50% / 0.2)')).toBe(0x40bfbf33);
127127
});
128128

129-
it('handles hwb properly', () => {
129+
test('handles hwb properly', () => {
130130
expect(normalizeColor('hwb(0, 0%, 100%)')).toBe(0x000000ff);
131131
expect(normalizeColor('hwb(0, 100%, 0%)')).toBe(0xffffffff);
132132
expect(normalizeColor('hwb(0, 0%, 0%)')).toBe(0xff0000ff);
@@ -137,20 +137,20 @@ it('handles hwb properly', () => {
137137
expect(normalizeColor('hwb(70 50% 0%)')).toBe(0xeaff80ff);
138138
});
139139

140-
it('handles named colors properly', () => {
140+
test('handles named colors properly', () => {
141141
expect(normalizeColor('red')).toBe(0xff0000ff);
142142
expect(normalizeColor('transparent')).toBe(0x00000000);
143143
expect(normalizeColor('peachpuff')).toBe(0xffdab9ff);
144144
});
145145

146-
it('handles number colors properly', () => {
146+
test('handles number colors properly', () => {
147147
expect(normalizeColor(0x00000000)).toBe(0x00000000);
148148
expect(normalizeColor(0xff0000ff)).toBe(0xff0000ff);
149149
expect(normalizeColor(0xffffffff)).toBe(0xffffffff);
150150
expect(normalizeColor(0x01234567)).toBe(0x01234567);
151151
});
152152

153-
it('returns the same color when it is already normalized', () => {
153+
test('returns the same color when it is already normalized', () => {
154154
const normalizedColor = normalizeColor('red') || 0;
155155
expect(normalizeColor(normalizedColor)).toBe(normalizedColor);
156156
});

packages/polyfills/__tests__/Object.es8-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ describe('Object (ES8)', () => {
1919
});
2020

2121
describe('Object.entries', () => {
22-
it('should have a length of 1', () => {
22+
test('should have a length of 1', () => {
2323
expect(Object.entries.length).toBe(1);
2424
});
2525

26-
it('should check for type', () => {
26+
test('should check for type', () => {
2727
expect(Object.entries.bind(null, null)).toThrow(
2828
TypeError('Object.entries called on non-object'),
2929
);
@@ -36,7 +36,7 @@ describe('Object (ES8)', () => {
3636
expect(Object.entries.bind(null, 'abc')).not.toThrow();
3737
});
3838

39-
it('should return enumerable entries', () => {
39+
test('should return enumerable entries', () => {
4040
const foo = Object.defineProperties(
4141
{},
4242
{
@@ -54,7 +54,7 @@ describe('Object (ES8)', () => {
5454
]);
5555
});
5656

57-
it('should work with proto-less objects', () => {
57+
test('should work with proto-less objects', () => {
5858
const foo = Object.create(null, {
5959
x: {value: 10, enumerable: true},
6060
y: {value: 20},
@@ -63,7 +63,7 @@ describe('Object (ES8)', () => {
6363
expect(Object.entries(foo)).toEqual([['x', 10]]);
6464
});
6565

66-
it('should return only own entries', () => {
66+
test('should return only own entries', () => {
6767
const foo = Object.create(
6868
{z: 30},
6969
{
@@ -75,7 +75,7 @@ describe('Object (ES8)', () => {
7575
expect(Object.entries(foo)).toEqual([['x', 10]]);
7676
});
7777

78-
it('should convert to object primitive string', () => {
78+
test('should convert to object primitive string', () => {
7979
expect(Object.entries('ab')).toEqual([
8080
['0', 'a'],
8181
['1', 'b'],
@@ -84,11 +84,11 @@ describe('Object (ES8)', () => {
8484
});
8585

8686
describe('Object.values', () => {
87-
it('should have a length of 1', () => {
87+
test('should have a length of 1', () => {
8888
expect(Object.values.length).toBe(1);
8989
});
9090

91-
it('should check for type', () => {
91+
test('should check for type', () => {
9292
expect(Object.values.bind(null, null)).toThrow(
9393
TypeError('Object.values called on non-object'),
9494
);
@@ -97,7 +97,7 @@ describe('Object (ES8)', () => {
9797
expect(Object.values.bind(null, {})).not.toThrow();
9898
});
9999

100-
it('should return enumerable values', () => {
100+
test('should return enumerable values', () => {
101101
const foo = Object.defineProperties(
102102
{},
103103
{
@@ -112,7 +112,7 @@ describe('Object (ES8)', () => {
112112
expect(Object.values(bar)).toEqual([10, 20]);
113113
});
114114

115-
it('should work with proto-less objects', () => {
115+
test('should work with proto-less objects', () => {
116116
const foo = Object.create(null, {
117117
x: {value: 10, enumerable: true},
118118
y: {value: 20},
@@ -121,7 +121,7 @@ describe('Object (ES8)', () => {
121121
expect(Object.values(foo)).toEqual([10]);
122122
});
123123

124-
it('should return only own values', () => {
124+
test('should return only own values', () => {
125125
const foo = Object.create(
126126
{z: 30},
127127
{
@@ -133,7 +133,7 @@ describe('Object (ES8)', () => {
133133
expect(Object.values(foo)).toEqual([10]);
134134
});
135135

136-
it('should convert to object primitive string', () => {
136+
test('should convert to object primitive string', () => {
137137
expect(Object.values('ab')).toEqual(['a', 'b']);
138138
});
139139
});

packages/react-native-codegen/e2e/__tests__/components/GenerateComponentDescriptorH-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GenerateComponentDescriptorH can generate for '${fixture}'`, () => {
25+
test(`GenerateComponentDescriptorH can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GenerateComponentHObjCpp-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GenerateComponentHObjCpp can generate for '${fixture}'`, () => {
25+
test(`GenerateComponentHObjCpp can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GenerateEventEmitterCpp-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GenerateEventEmitterCpp can generate for '${fixture}'`, () => {
25+
test(`GenerateEventEmitterCpp can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GenerateEventEmitterH-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GenerateEventEmitterH can generate for '${fixture}'`, () => {
25+
test(`GenerateEventEmitterH can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsCpp-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GeneratePropsCpp can generate for '${fixture}'`, () => {
25+
test(`GeneratePropsCpp can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsH-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GeneratePropsH can generate for '${fixture}'`, () => {
25+
test(`GeneratePropsH can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsJavaDelegate-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GeneratePropsJavaDelegate can generate for '${fixture}'`, () => {
25+
test(`GeneratePropsJavaDelegate can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/components/GeneratePropsJavaInterface-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2121
const parser = new FlowParser();
2222

2323
fixtures.forEach(fixture => {
24-
it(`GeneratePropsJavaInterface can generate for '${fixture}'`, () => {
24+
test(`GeneratePropsJavaInterface can generate for '${fixture}'`, () => {
2525
const libName = 'RNCodegenModuleFixtures';
2626
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2727
const output = generator.generate(libName, schema, undefined, false);

packages/react-native-codegen/e2e/__tests__/components/GenerateShadowNodeCpp-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2121
const parser = new FlowParser();
2222

2323
fixtures.forEach(fixture => {
24-
it(`GenerateShadowNodeCpp can generate for '${fixture}'`, () => {
24+
test(`GenerateShadowNodeCpp can generate for '${fixture}'`, () => {
2525
const libName = 'RNCodegenModuleFixtures';
2626
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2727
const output = generator.generate(libName, schema, undefined, false);

packages/react-native-codegen/e2e/__tests__/components/GenerateShadowNodeH-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2121
const parser = new FlowParser();
2222

2323
fixtures.forEach(fixture => {
24-
it(`GenerateShadowNodeH can generate for '${fixture}'`, () => {
24+
test(`GenerateShadowNodeH can generate for '${fixture}'`, () => {
2525
const libName = 'RNCodegenModuleFixtures';
2626
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2727
const output = generator.generate(libName, schema, undefined, false);

packages/react-native-codegen/e2e/__tests__/components/GenerateViewConfigJs-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fixtures = fs.readdirSync(FIXTURE_DIR);
2222
const parser = new FlowParser();
2323

2424
fixtures.forEach(fixture => {
25-
it(`GenerateViewConfigJs can generate for '${fixture}'`, () => {
25+
test(`GenerateViewConfigJs can generate for '${fixture}'`, () => {
2626
const libName = 'RNCodegenModuleFixtures';
2727
const schema = parser.parseFile(`${FIXTURE_DIR}/${fixture}`);
2828
const output = generator.generate(libName, schema);

packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleCpp-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ function getModules(): SchemaType {
3838
}
3939

4040
describe('GenerateModuleCpp', () => {
41-
it('can generate an implementation file NativeModule specs', () => {
41+
test('can generate an implementation file NativeModule specs', () => {
4242
const libName = 'RNCodegenModuleFixtures';
4343
const output = generator.generate(libName, getModules(), undefined, false);
4444
expect(output.get(libName + 'JSI-generated.cpp')).toMatchSnapshot();
4545
});
4646

47-
it('can generate a header file NativeModule specs with assume nonnull enabled', () => {
47+
test('can generate a header file NativeModule specs with assume nonnull enabled', () => {
4848
const libName = 'RNCodegenModuleFixtures';
4949
const output = generator.generate(libName, getModules(), undefined, true);
5050
expect(output.get(libName + 'JSI-generated.cpp')).toMatchSnapshot();

packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleH-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ function getModules(): SchemaType {
3838
}
3939

4040
describe('GenerateModuleH', () => {
41-
it('can generate a header file NativeModule specs', () => {
41+
test('can generate a header file NativeModule specs', () => {
4242
const libName = 'RNCodegenModuleFixtures';
4343
const output = generator.generate(libName, getModules(), undefined, false);
4444
expect(output.get(libName + 'JSI.h')).toMatchSnapshot();
4545
});
4646

47-
it('can generate a header file NativeModule specs with assume nonnull enabled', () => {
47+
test('can generate a header file NativeModule specs with assume nonnull enabled', () => {
4848
const libName = 'RNCodegenModuleFixtures';
4949
const output = generator.generate(libName, getModules(), undefined, true);
5050
expect(output.get(libName + 'JSI.h')).toMatchSnapshot();

packages/react-native-codegen/e2e/__tests__/modules/GenerateModuleObjCpp-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ function getModules(): SchemaType {
3838
}
3939

4040
describe('GenerateModuleObjCpp', () => {
41-
it('can generate a header file NativeModule specs', () => {
41+
test('can generate a header file NativeModule specs', () => {
4242
const libName = 'RNCodegenModuleFixtures';
4343
const output = generator.generate(libName, getModules(), undefined, false);
4444
expect(output.get(libName + '.h')).toMatchSnapshot();
4545
});
4646

47-
it('can generate a header file NativeModule specs with assume nonnull enabled', () => {
47+
test('can generate a header file NativeModule specs with assume nonnull enabled', () => {
4848
const libName = 'RNCodegenModuleFixtures';
4949
const output = generator.generate(libName, getModules(), undefined, true);
5050
expect(output.get(libName + '.h')).toMatchSnapshot();
5151
});
5252

53-
it('can generate an implementation file NativeModule specs', () => {
53+
test('can generate an implementation file NativeModule specs', () => {
5454
const libName = 'RNCodegenModuleFixtures';
5555
const output = generator.generate(libName, getModules(), undefined, false);
5656
expect(output.get(libName + '-generated.mm')).toMatchSnapshot();

0 commit comments

Comments
 (0)