Skip to content

Commit e743df0

Browse files
committed
test case
1 parent 7920946 commit e743df0

1 file changed

Lines changed: 55 additions & 55 deletions

File tree

packages/core/test/cache-layer/cacheLayerLoader.spec.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -54,62 +54,62 @@ describe('Test cache layer loader', () => {
5454
fs.rmSync(folderPath, { recursive: true, force: true });
5555
});
5656

57-
// it.each([
58-
// {
59-
// templateName: 'template-1',
60-
// cache: {
61-
// cacheTableName: 'employees',
62-
// sql: sinon.default.stub() as any,
63-
// profile: profiles[0].name,
64-
// } as CacheLayerInfo,
65-
// },
66-
// {
67-
// templateName: 'template-1',
68-
// cache: {
69-
// cacheTableName: 'departments',
70-
// sql: sinon.default.stub() as any,
71-
// profile: profiles[1].name,
72-
// } as CacheLayerInfo,
73-
// },
74-
// {
75-
// templateName: 'template-2',
76-
// cache: {
77-
// cacheTableName: 'jobs',
78-
// sql: sinon.default.stub() as any,
79-
// profile: profiles[2].name,
80-
// } as CacheLayerInfo,
81-
// },
82-
// ])(
83-
// 'Should export and load $cache.cacheTableName successful when start loader with cache settings for $templateName',
84-
// async ({ templateName, cache }) => {
85-
// // Arrange
86-
// // Act
87-
// const loader = new CacheLayerLoader(options, stubFactory as any);
88-
// await loader.load(templateName, cache);
57+
it.each([
58+
{
59+
templateName: 'template-1',
60+
cache: {
61+
cacheTableName: 'employees',
62+
sql: sinon.default.stub() as any,
63+
profile: profiles[0].name,
64+
} as CacheLayerInfo,
65+
},
66+
{
67+
templateName: 'template-1',
68+
cache: {
69+
cacheTableName: 'departments',
70+
sql: sinon.default.stub() as any,
71+
profile: profiles[1].name,
72+
} as CacheLayerInfo,
73+
},
74+
{
75+
templateName: 'template-2',
76+
cache: {
77+
cacheTableName: 'jobs',
78+
sql: sinon.default.stub() as any,
79+
profile: profiles[2].name,
80+
} as CacheLayerInfo,
81+
},
82+
])(
83+
'Should export and load $cache.cacheTableName successful when start loader with cache settings for $templateName',
84+
async ({ templateName, cache }) => {
85+
// Arrange
86+
// Act
87+
const loader = new CacheLayerLoader(options, stubFactory as any);
88+
await loader.load(templateName, cache);
8989

90-
// // Assert
91-
// const actual = (
92-
// await getQueryResults(
93-
// "select * from information_schema.tables where table_schema = 'vulcan'"
94-
// )
95-
// ).map((row) => {
96-
// return {
97-
// table: row['table_name'],
98-
// schema: row['table_schema'],
99-
// };
100-
// });
101-
// expect(actual).toEqual(
102-
// expect.arrayContaining([
103-
// {
104-
// table: cache.cacheTableName,
105-
// schema: vulcanCacheSchemaName,
106-
// },
107-
// ])
108-
// );
109-
// },
110-
// // Set 50s timeout to test cache loader export and load data
111-
// 50 * 10000
112-
// );
90+
// Assert
91+
const actual = (
92+
await getQueryResults(
93+
"select * from information_schema.tables where table_schema = 'vulcan'"
94+
)
95+
).map((row) => {
96+
return {
97+
table: row['table_name'],
98+
schema: row['table_schema'],
99+
};
100+
});
101+
expect(actual).toEqual(
102+
expect.arrayContaining([
103+
{
104+
table: cache.cacheTableName,
105+
schema: vulcanCacheSchemaName,
106+
},
107+
])
108+
);
109+
},
110+
// Set 50s timeout to test cache loader export and load data
111+
50 * 10000
112+
);
113113
it.each([
114114
{
115115
templateName: 'template-1',

0 commit comments

Comments
 (0)