Skip to content

Commit

Permalink
[WS-2021-0638][Security] bump mocha to 10.1.0 (#2711)
Browse files Browse the repository at this point in the history
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh committed Nov 21, 2022
1 parent ab98411 commit 9377fbb
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 278 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Resolve sub-dependent d3-color version and potential security issue ([#2454](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2454))
- [CVE-2022-3517] Bumps minimatch from 3.0.4 to 3.0.5 and [IBM X-Force ID: 220063] unset-value from 1.0.1 to 2.0.1 ([#2640](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2640))
- [CVE-2022-37601] Bump loader-utils to 2.0.3 ([#2689](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2689))
- [WS-2021-0638][Security] bump mocha to 10.1.0 ([#2711](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2711))

### 📈 Features/Enhancements

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
"load-grunt-config": "^4.0.1",
"load-json-file": "^6.2.0",
"markdown-it": "^12.3.2",
"mocha": "^7.2.0",
"mocha": "10.1.0",
"mock-fs": "^4.12.0",
"monaco-editor": "~0.17.0",
"ms-chromium-edge-driver": "^0.4.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('failure hooks', function () {
{
flag: '$FAILING_TEST$',
assert(lines) {
expect(lines.shift()).to.match(/\$FAILING_TEST\$/);
expect(lines.shift()).to.match(/global before each/);
expect(lines.shift()).to.match(/info\s+testFailure\s+\$FAILING_TEST_ERROR\$/);
expect(lines.shift()).to.match(/info\s+testFailureAfterDelay\s+\$FAILING_TEST_ERROR\$/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ it('only runs hooks of parents and tests in level1a', async () => {
"suite: ",
"suite: level 1",
"suite: level 1 level 1a",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"",
"test: level 1 level 1a test 1a",
]
`);
Expand All @@ -130,8 +130,8 @@ it('only runs hooks of parents and tests in level1b', async () => {
"suite: ",
"suite: level 1",
"suite: level 1 level 1b",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"",
"test: level 1 level 1b test 1b",
]
`);
Expand All @@ -149,12 +149,12 @@ it('only runs hooks of parents and tests in level1a and level1b', async () => {
"suite: ",
"suite: level 1",
"suite: level 1 level 1a",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"",
"test: level 1 level 1a test 1a",
"suite: level 1 level 1b",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"",
"test: level 1 level 1b test 1b",
]
`);
Expand All @@ -173,8 +173,8 @@ it('only runs level1a if including level1 and excluding level1b', async () => {
"suite: ",
"suite: level 1",
"suite: level 1 level 1a",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1a\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1a\\"",
"test: level 1 level 1a test 1a",
]
`);
Expand All @@ -193,8 +193,8 @@ it('only runs level1b if including level1 and excluding level1a', async () => {
"suite: ",
"suite: level 1",
"suite: level 1 level 1b",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: level 1 \\"before each\\" hook: level1BeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 1b\\"",
"hook: level 1 \\"before each\\" hook: level1BeforeEach for \\"test 1b\\"",
"test: level 1 level 1b test 1b",
]
`);
Expand All @@ -212,7 +212,7 @@ it('only runs level2 if excluding level1', async () => {
"suite: ",
"suite: level 2",
"suite: level 2 level 2a",
"hook: \\"before each\\" hook: rootBeforeEach",
"hook: \\"before each\\" hook: rootBeforeEach for \\"test 2a\\"",
"test: level 2 level 2a test 2a",
]
`);
Expand Down
Loading

0 comments on commit 9377fbb

Please sign in to comment.