|
|
@@ -48,6 +48,7 @@ describe('Plugins', () => {
|
|
|
const configService = server.app.get(ConfigService);
|
|
|
expect(configService instanceof ConfigService).toBe(true);
|
|
|
expect(configService.defaultLanguageCode).toBe(LanguageCode.zh);
|
|
|
+ expect(TestPluginWithConfig.configSpy).toHaveBeenCalledTimes(1);
|
|
|
});
|
|
|
|
|
|
it('extends the admin API', async () => {
|
|
|
@@ -137,3 +138,24 @@ describe('Plugins', () => {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+describe('Multiple bootstraps in same process', () => {
|
|
|
+ const activeConfig = testConfig();
|
|
|
+ const { server, adminClient, shopClient } = createTestEnvironment({
|
|
|
+ ...activeConfig,
|
|
|
+ plugins: [TestPluginWithConfig.setup()],
|
|
|
+ });
|
|
|
+
|
|
|
+ beforeAll(async () => {
|
|
|
+ await server.init({
|
|
|
+ initialData,
|
|
|
+ productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
|
|
|
+ customerCount: 1,
|
|
|
+ });
|
|
|
+ await adminClient.asSuperAdmin();
|
|
|
+ }, TEST_SETUP_TIMEOUT_MS);
|
|
|
+
|
|
|
+ it('plugin `configure` function called only once', async () => {
|
|
|
+ expect(TestPluginWithConfig.configSpy).toHaveBeenCalledTimes(1);
|
|
|
+ });
|
|
|
+});
|