Skip to content

Commit cbd16d7

Browse files
Track Jest resolver mocks for CI
1 parent 41c7195 commit cbd16d7

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

uapi/tests/mocks/observability.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
trace: async (_name, fn) => fn(),
3+
traceRoute: (_name, fn) => fn,
4+
traceStep: async (_name, fn) => fn(),
5+
generateTextTraced: async (...args) => {
6+
if (args.length === 1 && typeof args[0] === 'function') {
7+
return args[0]();
8+
}
9+
return undefined;
10+
},
11+
};

uapi/tests/styleMock.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const styleProxy = new Proxy(
2+
{},
3+
{
4+
get: (_target, prop) => {
5+
if (prop === '__esModule') return true;
6+
if (prop === 'default') return styleProxy;
7+
return String(prop);
8+
},
9+
},
10+
);
11+
12+
module.exports = styleProxy;
13+
module.exports.default = styleProxy;

uapi/tests/textMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'test-file-stub';

0 commit comments

Comments
 (0)