Skip to content

Commit

Permalink
upgrade msw
Browse files Browse the repository at this point in the history
flag=none

closes CFA-35

closes LF-1117

Change-Id: I42e65f70ee74a2931a0a4439a4c9c0f22466ef62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336892
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
  • Loading branch information
aaronshaf committed Jan 8, 2024
1 parent bb3a0d5 commit 3c0b43d
Show file tree
Hide file tree
Showing 14 changed files with 411 additions and 428 deletions.
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,9 @@ module.exports = {
},
],
},

testEnvironmentOptions: {
// https://github.com/mswjs/examples/blob/main/examples/with-jest/jest.config.ts#L20
customExportConditions: [''],
},
}
7 changes: 6 additions & 1 deletion jest/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import 'cross-fetch/polyfill'
import {TextDecoder, TextEncoder} from 'util'
import CoreTranslations from '../public/javascripts/translations/en.json'
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
Expand Down Expand Up @@ -84,7 +86,7 @@ window.ENV = {
use_rce_enhancements: true,
FEATURES: {
extended_submission_state: true,
}
},
}

Enzyme.configure({adapter: new Adapter()})
Expand Down Expand Up @@ -264,3 +266,6 @@ Document.prototype.createRange =
},
}
}

global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
"@tanstack/query-sync-storage-persister": "^4.36.1",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-persist-client": "^4.36.1",
"@types/b-spline": "^2.0.4",
"@types/dagre": "^0.7.52",
"@types/jquery.cookie": "^1.4.32",
"@types/react-dnd": "2.0.36",
"@types/twitter-text": "^3.1.2",
Expand All @@ -116,6 +118,7 @@
"apollo-utilities": "^1.3.2",
"axios": "^0.21.1",
"axios-cache-adapter": "^2.7.0",
"b-spline": "^2.0.2",
"backbone": "1.1.1",
"big.js": "^5.0.3",
"browserslist": "^4.19.1",
Expand All @@ -126,8 +129,10 @@
"color-slicer": "0.8.0",
"coverage-istanbul-loader": "^3.0.5",
"create-react-class": "^15.6.3",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.1.1",
"d3": "3.5.17",
"dagre": "^0.8.5",
"emoji-mart": "^3.0.1",
"export-from-json": "^1.6.0",
"final-form": "^4.20.2",
Expand Down Expand Up @@ -204,11 +209,7 @@
"velocity-animate": "^1.5.0",
"webpack-retry-chunk-load-plugin": "^3.1.1",
"yarn-deduplicate": "^3.0.1",
"zustand": "3.7.2",
"dagre": "^0.8.5",
"@types/dagre": "^0.7.52",
"b-spline": "^2.0.2",
"@types/b-spline": "^2.0.4"
"zustand": "3.7.2"
},
"devDependencies": {
"@apollo/react-common": "~3.0.1",
Expand Down Expand Up @@ -253,6 +254,7 @@
"@types/react-dom": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitest/ui": "^1.0.4",
"@yarnpkg/lockfile": "^1.0.2",
"array-flat-polyfill": "^1.0.1",
"axe-core": "~2.1.7",
Expand Down Expand Up @@ -335,7 +337,7 @@
"mockdate": "^2.0.2",
"moment-timezone-data-webpack-plugin": "^1.5.0",
"moxios": "^0.4",
"msw": "^0.43.1",
"msw": "^2.0.12",
"nyc": "^13",
"prettier": "^2.2.1",
"qunitjs": "^1.23.0",
Expand All @@ -356,7 +358,6 @@
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"vitest": "^1.0.4",
"@vitest/ui": "^1.0.4",
"waait": "^1",
"webpack": "^5",
"webpack-bundle-analyzer": "^4.5.0",
Expand Down
Loading

0 comments on commit 3c0b43d

Please sign in to comment.