How to use the @vendure/core.mergeConfig function in @vendure/core

To help you get started, we’ve selected a few @vendure/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vendure-ecommerce / vendure / e2e-common / test-config.ts View on Github external
*/
export const TEST_SETUP_TIMEOUT_MS = process.env.E2E_DEBUG ? 1800 * 1000 : 120000;

/**
 * For local debugging of the e2e tests, we set a very long timeout value otherwise tests will
 * automatically fail for going over the 5 second default timeout.
 */
if (process.env.E2E_DEBUG) {
    // tslint:disable-next-line:no-console
    console.log('E2E_DEBUG', process.env.E2E_DEBUG, ' - setting long timeout');
    jest.setTimeout(1800 * 1000);
}

const packageDir = getPackageDir();

export const testConfig = mergeConfig(defaultTestConfig, {
    importExportOptions: {
        importAssetsDir: path.join(packageDir, 'fixtures/assets'),
    },
});
github vendure-ecommerce / vendure / packages / dev-server / load-testing / load-test-config.ts View on Github external
export function getLoadTestConfig(tokenMethod: 'cookie' | 'bearer'): Required {
    const count = getProductCount();
    return mergeConfig(defaultConfig, {
        paymentOptions: {
            paymentMethodHandlers: [examplePaymentHandler],
        },
        orderOptions: {
            orderItemsLimit: 99999,
        },
        logger: new DefaultLogger({ level: LogLevel.Info }),
        dbConnectionOptions: getMysqlConnectionOptions(count),
        authOptions: {
            tokenMethod,
            requireVerification: false,
        },
        importExportOptions: {
            importAssetsDir: path.join(__dirname, './data-sources'),
        },
        workerOptions: {
github vendure-ecommerce / vendure / packages / core / e2e / customer.e2e-spec.ts View on Github external
describe('Customer resolver', () => {
    const { server, adminClient, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, { plugins: [TestEmailPlugin] }),
    );

    let firstCustomer: GetCustomerList.Items;
    let secondCustomer: GetCustomerList.Items;
    let thirdCustomer: GetCustomerList.Items;

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
            initialData,
            productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
            customerCount: 5,
        });
        await adminClient.asSuperAdmin();
    }, TEST_SETUP_TIMEOUT_MS);
github vendure-ecommerce / vendure / packages / core / e2e / shop-order.e2e-spec.ts View on Github external
describe('Shop orders', () => {
    const { server, adminClient, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, {
            paymentOptions: {
                paymentMethodHandlers: [
                    testSuccessfulPaymentMethod,
                    testFailingPaymentMethod,
                    testErrorPaymentMethod,
                ],
            },
            orderOptions: {
                orderItemsLimit: 99,
            },
        }),
    );

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
github vendure-ecommerce / vendure / packages / core / e2e / stock-control.e2e-spec.ts View on Github external
describe('Stock control', () => {
    const { server, adminClient, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, {
            paymentOptions: {
                paymentMethodHandlers: [testSuccessfulPaymentMethod],
            },
        }),
    );

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
            initialData,
            productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-stock-control.csv'),
            customerCount: 2,
        });
        await adminClient.asSuperAdmin();
    }, TEST_SETUP_TIMEOUT_MS);
github vendure-ecommerce / vendure / packages / core / e2e / shop-auth.e2e-spec.ts View on Github external
describe('Registration without email verification', () => {
    const { server, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, {
            plugins: [TestEmailPlugin as any],
            authOptions: {
                requireVerification: false,
            },
        }),
    );
    const userEmailAddress = 'glen.beardsley@test.com';

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
            initialData,
            productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
            customerCount: 1,
        });
    }, TEST_SETUP_TIMEOUT_MS);
github vendure-ecommerce / vendure / packages / core / e2e / default-search-plugin.e2e-spec.ts View on Github external
describe('Default search plugin', () => {
    const { server, adminClient, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, { plugins: [DefaultSearchPlugin] }),
    );

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
            initialData,
            productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
            customerCount: 1,
        });
        await adminClient.asSuperAdmin();
    }, TEST_SETUP_TIMEOUT_MS);

    afterAll(async () => {
        await server.destroy();
    });
github vendure-ecommerce / vendure / packages / elasticsearch-plugin / e2e / elasticsearch-plugin.e2e-spec.ts View on Github external
describe('Elasticsearch plugin', () => {
    const { server, adminClient, shopClient } = createTestEnvironment(
        mergeConfig(testConfig, {
            plugins: [
                ElasticsearchPlugin.init({
                    indexPrefix: 'e2e-tests',
                    port: process.env.CI ? +(process.env.ELASTICSEARCH_PORT || 9200) : 9200,
                    host: process.env.CI
                        ? process.env.ELASTICSEARCH_HOST || 'elasticsearch'
                        : 'http://192.168.99.100',
                }),
            ],
        }),
    );

    beforeAll(async () => {
        await server.init({
            dataDir: path.join(__dirname, '__data__'),
            initialData,