Skip to content

Commit 98b4c27

Browse files
committed
Update aws sdk to v3
1 parent a800235 commit 98b4c27

File tree

8 files changed

+1399
-430
lines changed

8 files changed

+1399
-430
lines changed

e2e/jest.setup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ jest.mock('node:stream', () => require('stream'))
2121
jest.mock('node:util', () => require('util'))
2222
jest.mock('node:path', () => require('path'))
2323
jest.mock('node:fs', () => require('fs'))
24+
jest.mock('node:fs/promises', () => require('fs/promises'))
25+
jest.mock('node:buffer', () => require('buffer'))
26+
jest.mock('node:events', () => require('events'))
27+
jest.mock('node:http', () => require('http'))
28+
jest.mock('node:https', () => require('https'))
29+
jest.mock('node:crypto', () => require('crypto'))
30+
jest.mock('node:os', () => require('os'))
31+
jest.mock('node:url', () => require('url'))
32+
jest.mock('node:zlib', () => require('zlib'))

packages/internal-lib-build/bin/internal-lib-build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ const main = () => {
5151
.action((_, {args}) => {
5252
const jest = p.join(require.resolve('jest'), '..', '..', '..', '.bin', 'jest')
5353
execSync(
54-
`${jest} --passWithNoTests --maxWorkers=2${args.length ? ' ' + args.join(' ') : ''}`
54+
`${jest} --passWithNoTests --maxWorkers=2${
55+
args.length ? ' ' + args.join(' ') : ''
56+
}`
5557
)
5658
})
5759

packages/internal-lib-build/configs/jest/setup-jest.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,37 @@
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7+
/* eslint-env jest */
78

89
import 'raf/polyfill' // fix requestAnimationFrame issue with polyfill
910
import fetch from 'jest-fetch-mock'
1011
import 'regenerator-runtime/runtime'
1112

1213
// Mock Fetch
1314
global.fetch = fetch
15+
16+
/**
17+
* Jest setup to handle Node.js built-in modules with 'node:' prefix.
18+
*
19+
* Problem: The AWS SDK (which uses parse5 internally) tries to import Node.js built-ins
20+
* using the 'node:' prefix (e.g., require('node:stream')), but Jest cannot resolve
21+
* these imports and throws "ENOENT: no such file or directory, open 'node:stream'".
22+
*
23+
* Solution: Mock the 'node:' prefixed imports to point to the standard Node.js modules.
24+
* This allows Jest to properly resolve these imports during testing.
25+
*
26+
* Related issue: https://github.com/inikulin/parse5/issues/1260
27+
*/
28+
jest.mock('node:stream', () => require('stream'))
29+
jest.mock('node:util', () => require('util'))
30+
jest.mock('node:path', () => require('path'))
31+
jest.mock('node:fs', () => require('fs'))
32+
jest.mock('node:fs/promises', () => require('fs/promises'))
33+
jest.mock('node:buffer', () => require('buffer'))
34+
jest.mock('node:events', () => require('events'))
35+
jest.mock('node:http', () => require('http'))
36+
jest.mock('node:https', () => require('https'))
37+
jest.mock('node:crypto', () => require('crypto'))
38+
jest.mock('node:os', () => require('os'))
39+
jest.mock('node:url', () => require('url'))
40+
jest.mock('node:zlib', () => require('zlib'))

0 commit comments

Comments
 (0)