File tree Expand file tree Collapse file tree
test/__mocks__/@objectstack
test/__mocks__/@objectstack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ module.exports = {
1212 testMatch : [ '**/test/**/*.test.ts' ] ,
1313 moduleNameMapper : {
1414 '^@objectql/(.*)$' : '<rootDir>/../$1/src' ,
15+ '^@objectstack/core$' : '<rootDir>/test/__mocks__/@objectstack/core.ts' ,
1516 } ,
1617 transform : {
1718 '^.+\\.(t|j)sx?$' : [ 'ts-jest' , {
Original file line number Diff line number Diff line change 1+ /**
2+ * ObjectQL
3+ * Copyright (c) 2026-present ObjectStack Inc.
4+ *
5+ * This source code is licensed under the MIT license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ /**
10+ * Mock for @objectstack/core to enable Jest testing
11+ *
12+ * Since @objectstack/core@0.9.2 uses ES modules with import.meta,
13+ * which Jest doesn't support well, we provide this mock for testing.
14+ */
15+
16+ export const createLogger = jest . fn ( ( ) => ( {
17+ trace : jest . fn ( ) ,
18+ debug : jest . fn ( ) ,
19+ info : jest . fn ( ) ,
20+ warn : jest . fn ( ) ,
21+ error : jest . fn ( ) ,
22+ fatal : jest . fn ( ) ,
23+ } ) ) ;
24+
25+ export const ObjectKernel = jest . fn ( ) ;
26+ export const LiteKernel = jest . fn ( ) ;
27+ export const createApiRegistryPlugin = jest . fn ( ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ module.exports = {
1212 testMatch : [ '**/test/**/*.test.ts' ] ,
1313 moduleNameMapper : {
1414 '^@objectql/(.*)$' : '<rootDir>/../$1/src' ,
15+ '^@objectstack/core$' : '<rootDir>/test/__mocks__/@objectstack/core.ts' ,
1516 } ,
1617 transform : {
1718 '^.+\\.(t|j)sx?$' : [ 'ts-jest' , {
Original file line number Diff line number Diff line change 1+ /**
2+ * ObjectQL
3+ * Copyright (c) 2026-present ObjectStack Inc.
4+ *
5+ * This source code is licensed under the MIT license found in the
6+ * LICENSE file in the root directory of this source tree.
7+ */
8+
9+ /**
10+ * Mock for @objectstack/core to enable Jest testing
11+ *
12+ * Since @objectstack/core@0.9.2 uses ES modules with import.meta,
13+ * which Jest doesn't support well, we provide this mock for testing.
14+ */
15+
16+ export const createLogger = jest . fn ( ( ) => ( {
17+ trace : jest . fn ( ) ,
18+ debug : jest . fn ( ) ,
19+ info : jest . fn ( ) ,
20+ warn : jest . fn ( ) ,
21+ error : jest . fn ( ) ,
22+ fatal : jest . fn ( ) ,
23+ } ) ) ;
24+
25+ export const ObjectKernel = jest . fn ( ) ;
26+ export const LiteKernel = jest . fn ( ) ;
27+ export const createApiRegistryPlugin = jest . fn ( ) ;
You can’t perform that action at this time.
0 commit comments