Skip to content

Commit 9a8ac81

Browse files
committed
test(credential-provider-node): rewrite integ in vitest
1 parent 9cd9415 commit 9a8ac81

File tree

8 files changed

+375
-198
lines changed

8 files changed

+375
-198
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
"kill-port": "^2.0.1",
105105
"lerna": "5.5.2",
106106
"lint-staged": "^10.0.1",
107+
"memfs": "^4.39.0",
107108
"prettier": "2.8.5",
108109
"rimraf": "3.0.2",
109110
"ts-jest": "29.1.1",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const child_process = require("node:child_process");
2+
3+
module.exports = {
4+
...child_process,
5+
exec(bin, ...args) {
6+
const callback = args.find((arg) => typeof arg === "function");
7+
if (bin === "credential-process") {
8+
return callback(null, {
9+
stdout: JSON.stringify({
10+
Version: 1,
11+
AccessKeyId: "PROCESS_ACCESS_KEY_ID",
12+
SecretAccessKey: "PROCESS_SECRET_ACCESS_KEY",
13+
SessionToken: "PROCESS_SESSION_TOKEN",
14+
}),
15+
});
16+
}
17+
return child_process.exec(bin, ...args);
18+
},
19+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const { fs } = require("memfs");
2+
module.exports = fs;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const { fs } = require("memfs");
2+
module.exports = fs.promises;

packages/credential-provider-node/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
1717
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
1818
"test": "yarn g:vitest run",
19-
"test:integration": "yarn g:jest -c jest.config.integ.js",
20-
"test:watch": "yarn g:vitest watch"
19+
"test:watch": "yarn g:vitest watch",
20+
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
21+
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
2122
},
2223
"keywords": [
2324
"aws",

0 commit comments

Comments
 (0)