Skip to content

Commit

Permalink
test: add exports test to all libs
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 11, 2023
1 parent 44e6733 commit 117634c
Show file tree
Hide file tree
Showing 33 changed files with 204 additions and 30 deletions.
2 changes: 0 additions & 2 deletions apps/app-builder/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
test: {
environment: 'node',
},
Expand Down
5 changes: 1 addition & 4 deletions apps/checkout-js/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
5 changes: 1 addition & 4 deletions apps/checkout/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
4 changes: 4 additions & 0 deletions libs/admin/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"clean": "run ws:clean \"$(pwd)\"",
"lint": "run ws:lint \"$(pwd)\"",
"lint:fix": "run ws:lint:fix \"$(pwd)\"",
"test": "run ws:test \"$(pwd)\"",
"test:coverage": "run ws:test:coverage \"$(pwd)\"",
"test:run": "run ws:test:run \"$(pwd)\"",
"test:update": "run ws:test:update \"$(pwd)\"",
"typecheck": "run ws:ts:typecheck \"$(pwd)\""
},
"dependencies": {
Expand Down
24 changes: 24 additions & 0 deletions libs/admin/common/src/__tests__/__snapshots__/exports.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"ADMIN_COMPONENT_PREFIX",
"AdminComponent",
"AdminIcon",
"AdminView",
"BACKEND_ENDPOINTS_ORDERS",
"BACKEND_ENDPOINTS_SHIPMENTS",
"BACKEND_ENDPOINTS_WEBHOOKS",
"BackendEndpoint",
"NotificationCategory",
"Size",
"Status",
"Variant",
"allAdminComponentNames",
"optionalAdminActionContainerComponentNames",
"optionalAdminPlainWrapperComponentNames",
"prefixComponent",
"requiredAdminComponentNames",
"unprefixComponent",
]
`;
8 changes: 8 additions & 0 deletions libs/admin/common/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
3 changes: 3 additions & 0 deletions libs/admin/common/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig();
4 changes: 4 additions & 0 deletions libs/admin/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"clean": "run ws:clean \"$(pwd)\"",
"lint": "run ws:lint \"$(pwd)\"",
"lint:fix": "run ws:lint:fix \"$(pwd)\"",
"test": "run ws:test \"$(pwd)\"",
"test:coverage": "run ws:test:coverage \"$(pwd)\"",
"test:run": "run ws:test:run \"$(pwd)\"",
"test:update": "run ws:test:update \"$(pwd)\"",
"typecheck": "run ws:ts:typecheck \"$(pwd)\""
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"mockDefaultAccount",
"mockDefaultAppInfo",
"mockDefaultCarriers",
"mockDefaultDynamicContext",
"mockDefaultPlatform",
"mockDefaultPluginSettings",
"mockDefaultPrintOptionsView",
"mockDefaultShop",
]
`;
8 changes: 8 additions & 0 deletions libs/admin/testing/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
3 changes: 3 additions & 0 deletions libs/admin/testing/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig();
4 changes: 4 additions & 0 deletions libs/checkout/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"clean": "run ws:clean \"$(pwd)\"",
"lint": "run ws:lint \"$(pwd)\"",
"lint:fix": "run ws:lint:fix \"$(pwd)\"",
"test": "run ws:test \"$(pwd)\"",
"test:coverage": "run ws:test:coverage \"$(pwd)\"",
"test:run": "run ws:test:run \"$(pwd)\"",
"test:update": "run ws:test:update \"$(pwd)\"",
"typecheck": "run ws:ts:typecheck \"$(pwd)\""
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"AddressField",
"AddressType",
"FrontendEndpoint",
"PdkEvent",
"PdkField",
]
`;
8 changes: 8 additions & 0 deletions libs/checkout/common/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
3 changes: 3 additions & 0 deletions libs/checkout/common/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig();
8 changes: 8 additions & 0 deletions libs/checkout/core/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
5 changes: 1 addition & 4 deletions libs/checkout/core/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"DeliveryOptionsMode",
"PdkDeliveryOptionsEvent",
"createDeliveryOptionsStore",
"getResolvedSettings",
"initializeCheckoutDeliveryOptions",
"useDeliveryOptionsStore",
]
`;
8 changes: 8 additions & 0 deletions libs/checkout/delivery-options/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
5 changes: 1 addition & 4 deletions libs/checkout/delivery-options/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"SPLIT_STREET_REGEX",
"initializeCheckoutSeparateAddressFields",
]
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
5 changes: 1 addition & 4 deletions libs/checkout/separate-address-fields/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"initializeCheckoutTaxFields",
]
`;
8 changes: 8 additions & 0 deletions libs/checkout/tax-fields/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
5 changes: 1 addition & 4 deletions libs/checkout/tax-fields/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();
4 changes: 4 additions & 0 deletions libs/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"emit": "run ws:ts:emit \"$(pwd)\"",
"lint": "run ws:lint \"$(pwd)\"",
"lint:fix": "run ws:lint:fix \"$(pwd)\"",
"test": "run ws:test \"$(pwd)\"",
"test:coverage": "run ws:test:coverage \"$(pwd)\"",
"test:run": "run ws:test:run \"$(pwd)\"",
"test:update": "run ws:test:update \"$(pwd)\"",
"typecheck": "run ws:ts:typecheck \"$(pwd)\""
},
"devDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions libs/common/src/__tests__/__snapshots__/exports.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"Size",
"Status",
"Variant",
]
`;
8 changes: 8 additions & 0 deletions libs/common/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
3 changes: 3 additions & 0 deletions libs/common/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig();
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`exports > exports from index.ts 1`] = `
[
"EVENT_HIDE_DELIVERY_OPTIONS",
"EVENT_SHOW_DELIVERY_OPTIONS",
"EVENT_UPDATED_ADDRESS",
"EVENT_UPDATED_DELIVERY_OPTIONS",
"EVENT_UPDATE_CONFIG",
"EVENT_UPDATE_DELIVERY_OPTIONS",
]
`;
8 changes: 8 additions & 0 deletions libs/delivery-options/src/__tests__/exports.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {describe, expect, it} from 'vitest';
import * as index from '../index';

describe('exports', () => {
it('exports from index.ts', () => {
expect(Object.keys(index).sort()).toMatchSnapshot();
});
});
5 changes: 1 addition & 4 deletions libs/delivery-options/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import vue from '@vitejs/plugin-vue';
import {createViteConfig} from '@myparcel-pdk/build-vite';

export default createViteConfig({
plugins: [vue()],
});
export default createViteConfig();

0 comments on commit 117634c

Please sign in to comment.