Skip to content

Commit 86e73f5

Browse files
authored
chore: enforce LF line endings (#8809)
* chore: enforce LF line endings * Update CHANGELOG.md * Update .editorconfig
1 parent d9b43a8 commit 86e73f5

9 files changed

+238
-229
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- restore-cache: *restore-cache
2828
- run: yarn --no-progress --frozen-lockfile
2929
- save-cache: *save-cache
30-
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:md:ci && yarn check-copyright-headers
30+
- run: yarn lint --format junit -o reports/junit/js-lint-results.xml && yarn lint-es5-build --format junit -o reports/junit/js-es5-lint-results.xml && yarn lint:prettier:ci && yarn check-copyright-headers
3131
- store_test_results:
3232
path: reports/junit
3333

.editorconfig

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
#
5+
# Some of these options are also respected by Prettier
6+
17
root = true
28

39
[*]
410
indent_style = space
511
indent_size = 2
12+
13+
end_of_line = lf
614
charset = utf-8
715
trim_trailing_whitespace = true
816
insert_final_newline = true
917

10-
[{*.md,*.snap}]
18+
[*.{md,snap}]
1119
trim_trailing_whitespace = false

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- `[docs]` Fix MockFunctions example that was using toContain instead of toContainEqual ([#8765](https://github.com/facebook/jest/pull/8765))
5353
- `[*]` Make sure copyright header comment includes license ([#8783](https://github.com/facebook/jest/pull/8783))
5454
- `[docs]` Fix WatchPlugins `jestHooks.shouldRunTestSuite` example that receives an object ([#8784](https://github.com/facebook/jest/pull/8784))
55+
- `[*]` Enforce LF line endings ([#8809](https://github.com/facebook/jest/pull/8809))
5556

5657
### Performance
5758

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
"jest-coverage": "yarn jest --coverage",
8787
"lint": "eslint . --cache --report-unused-disable-directives --ext js,jsx,ts,tsx,md",
8888
"lint-es5-build": "eslint --no-eslintrc --no-ignore --env=browser packages/*/build-es5",
89-
"lint:md": "yarn --silent lint:md:ci --fix",
90-
"lint:md:ci": "prettylint '**/*.{md,yml,yaml}' --ignore-path .gitignore",
89+
"lint:prettier": "yarn --silent lint:prettier:ci --fix",
90+
"lint:prettier:ci": "prettylint '**/*.{md,yml,yaml}' --ignore-path .gitignore",
9191
"postinstall": "opencollective postinstall && yarn build",
9292
"publish": "yarn build-clean && yarn build && lerna publish --silent",
9393
"test-ci-es5-build-in-browser": "karma start --single-run",
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
*/
8-
9-
import fc from 'fast-check';
10-
11-
// settings for anything arbitrary
12-
export const anythingSettings = {
13-
key: fc.oneof(fc.string(), fc.constantFrom('k1', 'k2', 'k3')),
14-
maxDepth: 2, // Limit object depth (default: 2)
15-
maxKeys: 5, // Limit number of keys per object (default: 5)
16-
withBoxedValues: true,
17-
// Issue #7975 have to be fixed before enabling the generation of Map
18-
withMap: false,
19-
// Issue #7975 have to be fixed before enabling the generation of Set
20-
withSet: false,
21-
};
22-
23-
// assertion settings
24-
export const assertSettings = {}; // eg.: {numRuns: 10000}
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
*/
8+
9+
import fc from 'fast-check';
10+
11+
// settings for anything arbitrary
12+
export const anythingSettings = {
13+
key: fc.oneof(fc.string(), fc.constantFrom('k1', 'k2', 'k3')),
14+
maxDepth: 2, // Limit object depth (default: 2)
15+
maxKeys: 5, // Limit number of keys per object (default: 5)
16+
withBoxedValues: true,
17+
// Issue #7975 have to be fixed before enabling the generation of Map
18+
withMap: false,
19+
// Issue #7975 have to be fixed before enabling the generation of Set
20+
withSet: false,
21+
};
22+
23+
// assertion settings
24+
export const assertSettings = {}; // eg.: {numRuns: 10000}
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
*/
8-
9-
import fc from 'fast-check';
10-
import {
11-
anythingSettings,
12-
assertSettings,
13-
} from './__arbitraries__/sharedSettings';
14-
15-
describe('toContain', () => {
16-
it('should always find the value when inside the array', () => {
17-
fc.assert(
18-
fc.property(
19-
fc.array(fc.anything(anythingSettings)),
20-
fc.array(fc.anything(anythingSettings)),
21-
fc.anything(anythingSettings).filter(v => !Number.isNaN(v)),
22-
(startValues, endValues, v) => {
23-
// Given: startValues, endValues arrays and v value (not NaN)
24-
expect([...startValues, v, ...endValues]).toContain(v);
25-
},
26-
),
27-
assertSettings,
28-
);
29-
});
30-
31-
it('should not find the value if it has been cloned into the array', () => {
32-
fc.assert(
33-
fc.property(
34-
fc.array(fc.anything(anythingSettings)),
35-
fc.array(fc.anything(anythingSettings)),
36-
fc.dedup(fc.anything(anythingSettings), 2),
37-
(startValues, endValues, [a, b]) => {
38-
// Given: startValues, endValues arrays
39-
// and [a, b] equal, but not the same values
40-
// with `typeof a === 'object && a !== null`
41-
fc.pre(typeof a === 'object' && a !== null);
42-
expect([...startValues, a, ...endValues]).not.toContain(b);
43-
},
44-
),
45-
assertSettings,
46-
);
47-
});
48-
});
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
*/
8+
9+
import fc from 'fast-check';
10+
import {
11+
anythingSettings,
12+
assertSettings,
13+
} from './__arbitraries__/sharedSettings';
14+
15+
describe('toContain', () => {
16+
it('should always find the value when inside the array', () => {
17+
fc.assert(
18+
fc.property(
19+
fc.array(fc.anything(anythingSettings)),
20+
fc.array(fc.anything(anythingSettings)),
21+
fc.anything(anythingSettings).filter(v => !Number.isNaN(v)),
22+
(startValues, endValues, v) => {
23+
// Given: startValues, endValues arrays and v value (not NaN)
24+
expect([...startValues, v, ...endValues]).toContain(v);
25+
},
26+
),
27+
assertSettings,
28+
);
29+
});
30+
31+
it('should not find the value if it has been cloned into the array', () => {
32+
fc.assert(
33+
fc.property(
34+
fc.array(fc.anything(anythingSettings)),
35+
fc.array(fc.anything(anythingSettings)),
36+
fc.dedup(fc.anything(anythingSettings), 2),
37+
(startValues, endValues, [a, b]) => {
38+
// Given: startValues, endValues arrays
39+
// and [a, b] equal, but not the same values
40+
// with `typeof a === 'object && a !== null`
41+
fc.pre(typeof a === 'object' && a !== null);
42+
expect([...startValues, a, ...endValues]).not.toContain(b);
43+
},
44+
),
45+
assertSettings,
46+
);
47+
});
48+
});
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*
7-
*/
8-
9-
import fc from 'fast-check';
10-
import {
11-
anythingSettings,
12-
assertSettings,
13-
} from './__arbitraries__/sharedSettings';
14-
15-
describe('toContainEqual', () => {
16-
it('should always find the value when inside the array', () => {
17-
fc.assert(
18-
fc.property(
19-
fc.array(fc.anything(anythingSettings)),
20-
fc.array(fc.anything(anythingSettings)),
21-
fc.anything(anythingSettings),
22-
(startValues, endValues, v) => {
23-
// Given: startValues, endValues arrays and v any value
24-
expect([...startValues, v, ...endValues]).toContainEqual(v);
25-
},
26-
),
27-
assertSettings,
28-
);
29-
});
30-
31-
it('should always find the value when cloned inside the array', () => {
32-
fc.assert(
33-
fc.property(
34-
fc.array(fc.anything(anythingSettings)),
35-
fc.array(fc.anything(anythingSettings)),
36-
fc.dedup(fc.anything(anythingSettings), 2),
37-
(startValues, endValues, [a, b]) => {
38-
// Given: startValues, endValues arrays
39-
// and [a, b] identical values
40-
expect([...startValues, a, ...endValues]).toContainEqual(b);
41-
},
42-
),
43-
assertSettings,
44-
);
45-
});
46-
});
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
*/
8+
9+
import fc from 'fast-check';
10+
import {
11+
anythingSettings,
12+
assertSettings,
13+
} from './__arbitraries__/sharedSettings';
14+
15+
describe('toContainEqual', () => {
16+
it('should always find the value when inside the array', () => {
17+
fc.assert(
18+
fc.property(
19+
fc.array(fc.anything(anythingSettings)),
20+
fc.array(fc.anything(anythingSettings)),
21+
fc.anything(anythingSettings),
22+
(startValues, endValues, v) => {
23+
// Given: startValues, endValues arrays and v any value
24+
expect([...startValues, v, ...endValues]).toContainEqual(v);
25+
},
26+
),
27+
assertSettings,
28+
);
29+
});
30+
31+
it('should always find the value when cloned inside the array', () => {
32+
fc.assert(
33+
fc.property(
34+
fc.array(fc.anything(anythingSettings)),
35+
fc.array(fc.anything(anythingSettings)),
36+
fc.dedup(fc.anything(anythingSettings), 2),
37+
(startValues, endValues, [a, b]) => {
38+
// Given: startValues, endValues arrays
39+
// and [a, b] identical values
40+
expect([...startValues, a, ...endValues]).toContainEqual(b);
41+
},
42+
),
43+
assertSettings,
44+
);
45+
});
46+
});

0 commit comments

Comments
 (0)