Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit af37832

Browse files
committed
chore: use assert instead of expect for tests
1 parent ed2b304 commit af37832

3 files changed

Lines changed: 16 additions & 168 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@
112112
"@sourcegraph/prettierrc": "^2.2.0",
113113
"@sourcegraph/tsconfig": "^3.0.0",
114114
"@sourcegraph/tslint-config": "^12.1.0",
115-
"@types/expect": "^1.20.4",
116115
"@types/mocha": "^5.2.6",
116+
"@types/node": "^12.7.3",
117117
"@types/sinon": "^7.0.8",
118-
"expect": "^24.1.0",
119118
"husky": "^1.3.1",
120119
"mocha": "^6.0.2",
121120
"nyc": "^13.3.0",

src/codeOwners.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import expect from 'expect'
1+
import assert from 'assert'
22
import { formatCodeOwners } from './codeOwners'
33

44
describe('formatCodeOwners', () => {
5-
it('formats null', () => expect(formatCodeOwners(null)).toEqual({ label: null, description: null }))
5+
it('formats null', () => assert.deepStrictEqual(formatCodeOwners(null), { label: null, description: null }))
66
it('formats empty', () =>
7-
expect(formatCodeOwners([])).toEqual({ label: 'No owner', description: 'File has no code owner' }))
7+
assert.deepStrictEqual(formatCodeOwners([]), { label: 'No owner', description: 'File has no code owner' }))
88
it('formats 1', () =>
9-
expect(formatCodeOwners(['alice'])).toEqual({ label: 'Owner: alice', description: 'Code owner: alice' }))
9+
assert.deepStrictEqual(formatCodeOwners(['alice']), {
10+
label: 'Owner: alice',
11+
description: 'Code owner: alice',
12+
}))
1013
it('formats 1 with long name', () =>
11-
expect(formatCodeOwners(['alice-long-name'])).toEqual({
14+
assert.deepStrictEqual(formatCodeOwners(['alice-long-name']), {
1215
label: 'Owner',
1316
description: 'Code owner: alice-long-name',
1417
}))
1518
it('formats 2', () =>
16-
expect(formatCodeOwners(['alice', 'bob'])).toEqual({
19+
assert.deepStrictEqual(formatCodeOwners(['alice', 'bob']), {
1720
label: '2 owners',
1821
description: 'Code owners: alice, bob',
1922
}))

yarn.lock

Lines changed: 6 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -842,42 +842,6 @@
842842
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.3.tgz#f060bf6eaafae4d56a7dac618980838b0696e2ab"
843843
integrity sha512-FmuxfCuolpLl0AnQ2NHSzoUKWEJDFl63qXjzdoWBVyFCXzMGm1spBzk7LeHNoVCiWCF7mRVms9e6jEV9+MoPbg==
844844

845-
"@jest/console@^24.9.0":
846-
version "24.9.0"
847-
resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0"
848-
integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==
849-
dependencies:
850-
"@jest/source-map" "^24.9.0"
851-
chalk "^2.0.1"
852-
slash "^2.0.0"
853-
854-
"@jest/source-map@^24.9.0":
855-
version "24.9.0"
856-
resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714"
857-
integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg==
858-
dependencies:
859-
callsites "^3.0.0"
860-
graceful-fs "^4.1.15"
861-
source-map "^0.6.0"
862-
863-
"@jest/test-result@^24.9.0":
864-
version "24.9.0"
865-
resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca"
866-
integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==
867-
dependencies:
868-
"@jest/console" "^24.9.0"
869-
"@jest/types" "^24.9.0"
870-
"@types/istanbul-lib-coverage" "^2.0.0"
871-
872-
"@jest/types@^24.9.0":
873-
version "24.9.0"
874-
resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59"
875-
integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==
876-
dependencies:
877-
"@types/istanbul-lib-coverage" "^2.0.0"
878-
"@types/istanbul-reports" "^1.1.1"
879-
"@types/yargs" "^13.0.0"
880-
881845
"@marionebl/sander@^0.6.0":
882846
version "0.6.1"
883847
resolved "https://registry.yarnpkg.com/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b"
@@ -996,36 +960,16 @@
996960
tslint-config-prettier "^1.6.0"
997961
tslint-react "^3.2.0"
998962

999-
"@types/expect@^1.20.4":
1000-
version "1.20.4"
1001-
resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5"
1002-
integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==
1003-
1004-
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
1005-
version "2.0.1"
1006-
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
1007-
integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==
1008-
1009-
"@types/istanbul-lib-report@*":
1010-
version "1.1.1"
1011-
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c"
1012-
integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==
1013-
dependencies:
1014-
"@types/istanbul-lib-coverage" "*"
1015-
1016-
"@types/istanbul-reports@^1.1.1":
1017-
version "1.1.1"
1018-
resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a"
1019-
integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==
1020-
dependencies:
1021-
"@types/istanbul-lib-coverage" "*"
1022-
"@types/istanbul-lib-report" "*"
1023-
1024963
"@types/mocha@^5.2.6":
1025964
version "5.2.7"
1026965
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea"
1027966
integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==
1028967

968+
"@types/node@^12.7.3":
969+
version "12.7.3"
970+
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.3.tgz#27b3f40addaf2f580459fdb405222685542f907a"
971+
integrity sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ==
972+
1029973
"@types/q@^1.5.1":
1030974
version "1.5.2"
1031975
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
@@ -1036,23 +980,6 @@
1036980
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313"
1037981
integrity sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==
1038982

1039-
"@types/stack-utils@^1.0.1":
1040-
version "1.0.1"
1041-
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
1042-
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
1043-
1044-
"@types/yargs-parser@*":
1045-
version "13.0.0"
1046-
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.0.0.tgz#453743c5bbf9f1bed61d959baab5b06be029b2d0"
1047-
integrity sha512-wBlsw+8n21e6eTd4yVv8YD/E3xq0O6nNnJIquutAsFGE7EyMKz7W6RNT6BRu1SmdgmlCZ9tb0X+j+D6HGr8pZw==
1048-
1049-
"@types/yargs@^13.0.0":
1050-
version "13.0.2"
1051-
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.2.tgz#a64674fc0149574ecd90ba746e932b5a5f7b3653"
1052-
integrity sha512-lwwgizwk/bIIU+3ELORkyuOgDjCh7zuWDFqRtPPhhVgq9N1F7CvLNKg1TX4f2duwtKQ0p044Au9r1PLIXHrIzQ==
1053-
dependencies:
1054-
"@types/yargs-parser" "*"
1055-
1056983
JSONStream@^1.0.4:
1057984
version "1.3.5"
1058985
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
@@ -1124,7 +1051,7 @@ ansi-regex@^3.0.0:
11241051
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
11251052
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
11261053

1127-
ansi-regex@^4.0.0, ansi-regex@^4.1.0:
1054+
ansi-regex@^4.1.0:
11281055
version "4.1.0"
11291056
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
11301057
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
@@ -2376,11 +2303,6 @@ detect-libc@^1.0.2:
23762303
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
23772304
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
23782305

2379-
diff-sequences@^24.9.0:
2380-
version "24.9.0"
2381-
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5"
2382-
integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==
2383-
23842306
diff@3.5.0, diff@^3.2.0, diff@^3.5.0:
23852307
version "3.5.0"
23862308
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
@@ -2687,18 +2609,6 @@ expand-brackets@^2.1.4:
26872609
snapdragon "^0.8.1"
26882610
to-regex "^3.0.1"
26892611

2690-
expect@^24.1.0:
2691-
version "24.9.0"
2692-
resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca"
2693-
integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==
2694-
dependencies:
2695-
"@jest/types" "^24.9.0"
2696-
ansi-styles "^3.2.0"
2697-
jest-get-type "^24.9.0"
2698-
jest-matcher-utils "^24.9.0"
2699-
jest-message-util "^24.9.0"
2700-
jest-regex-util "^24.9.0"
2701-
27022612
extend-shallow@^2.0.1:
27032613
version "2.0.1"
27042614
resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
@@ -3703,50 +3613,6 @@ istanbul-reports@^2.1.1:
37033613
dependencies:
37043614
handlebars "^4.1.0"
37053615

3706-
jest-diff@^24.9.0:
3707-
version "24.9.0"
3708-
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da"
3709-
integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==
3710-
dependencies:
3711-
chalk "^2.0.1"
3712-
diff-sequences "^24.9.0"
3713-
jest-get-type "^24.9.0"
3714-
pretty-format "^24.9.0"
3715-
3716-
jest-get-type@^24.9.0:
3717-
version "24.9.0"
3718-
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e"
3719-
integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==
3720-
3721-
jest-matcher-utils@^24.9.0:
3722-
version "24.9.0"
3723-
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073"
3724-
integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA==
3725-
dependencies:
3726-
chalk "^2.0.1"
3727-
jest-diff "^24.9.0"
3728-
jest-get-type "^24.9.0"
3729-
pretty-format "^24.9.0"
3730-
3731-
jest-message-util@^24.9.0:
3732-
version "24.9.0"
3733-
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3"
3734-
integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==
3735-
dependencies:
3736-
"@babel/code-frame" "^7.0.0"
3737-
"@jest/test-result" "^24.9.0"
3738-
"@jest/types" "^24.9.0"
3739-
"@types/stack-utils" "^1.0.1"
3740-
chalk "^2.0.1"
3741-
micromatch "^3.1.10"
3742-
slash "^2.0.0"
3743-
stack-utils "^1.0.1"
3744-
3745-
jest-regex-util@^24.9.0:
3746-
version "24.9.0"
3747-
resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636"
3748-
integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA==
3749-
37503616
js-beautify@^1.8.9:
37513617
version "1.10.2"
37523618
resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.10.2.tgz#88c9099cd6559402b124cfab18754936f8a7b178"
@@ -5381,16 +5247,6 @@ prettier@^1.16.4:
53815247
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
53825248
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
53835249

5384-
pretty-format@^24.9.0:
5385-
version "24.9.0"
5386-
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9"
5387-
integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==
5388-
dependencies:
5389-
"@jest/types" "^24.9.0"
5390-
ansi-regex "^4.0.0"
5391-
ansi-styles "^3.2.0"
5392-
react-is "^16.8.4"
5393-
53945250
private@^0.1.6:
53955251
version "0.1.8"
53965252
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
@@ -5520,11 +5376,6 @@ rc@^1.2.7:
55205376
minimist "^1.2.0"
55215377
strip-json-comments "~2.0.1"
55225378

5523-
react-is@^16.8.4:
5524-
version "16.9.0"
5525-
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
5526-
integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==
5527-
55285379
read-pkg-up@^3.0.0:
55295380
version "3.0.0"
55305381
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07"
@@ -6201,11 +6052,6 @@ stable@^0.1.8:
62016052
resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
62026053
integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==
62036054

6204-
stack-utils@^1.0.1:
6205-
version "1.0.2"
6206-
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8"
6207-
integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==
6208-
62096055
static-eval@^2.0.0:
62106056
version "2.0.2"
62116057
resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42"

0 commit comments

Comments
 (0)