@vendure/testing 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @vendure/testing
2
-
3
- This package contains utilities for writing end-to-end tests for Vendure.
4
-
5
- For documentation, see [www.vendure.io/docs/developer-guide/testing/](https://www.vendure.io/docs/developer-guide/testing/)
6
-
1
+ # @vendure/testing
2
+
3
+ This package contains utilities for writing end-to-end tests for Vendure.
4
+
5
+ For documentation, see [www.vendure.io/docs/developer-guide/testing/](https://www.vendure.io/docs/developer-guide/testing/)
6
+
@@ -49,15 +49,15 @@ class MockDataService {
49
49
  for (let i = 0; i < count; i++) {
50
50
  const firstName = en_GB_1.default.name.firstName();
51
51
  const lastName = en_GB_1.default.name.lastName();
52
- const query1 = (0, graphql_tag_1.default) `
53
- mutation CreateCustomer($input: CreateCustomerInput!, $password: String) {
54
- createCustomer(input: $input, password: $password) {
55
- ... on Customer {
56
- id
57
- emailAddress
58
- }
59
- }
60
- }
52
+ const query1 = (0, graphql_tag_1.default) `
53
+ mutation CreateCustomer($input: CreateCustomerInput!, $password: String) {
54
+ createCustomer(input: $input, password: $password) {
55
+ ... on Customer {
56
+ id
57
+ emailAddress
58
+ }
59
+ }
60
+ }
61
61
  `;
62
62
  const variables1 = {
63
63
  input: {
@@ -72,13 +72,13 @@ class MockDataService {
72
72
  .query(query1, variables1)
73
73
  .then((data) => data.createCustomer, err => this.log(err));
74
74
  if (customer) {
75
- const query2 = (0, graphql_tag_1.default) `
76
- mutation ($customerId: ID!, $input: CreateAddressInput!) {
77
- createCustomerAddress(customerId: $customerId, input: $input) {
78
- id
79
- streetLine1
80
- }
81
- }
75
+ const query2 = (0, graphql_tag_1.default) `
76
+ mutation ($customerId: ID!, $input: CreateAddressInput!) {
77
+ createCustomerAddress(customerId: $customerId, input: $input) {
78
+ id
79
+ streetLine1
80
+ }
81
+ }
82
82
  `;
83
83
  const variables2 = {
84
84
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendure/testing",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "End-to-end testing tools for Vendure projects",
5
5
  "keywords": [
6
6
  "vendure",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@graphql-typed-document-node/core": "^3.2.0",
40
- "@vendure/common": "^2.3.2",
40
+ "@vendure/common": "^2.3.4",
41
41
  "faker": "^4.1.0",
42
42
  "form-data": "^4.0.0",
43
43
  "graphql": "~16.9.0",
@@ -50,11 +50,11 @@
50
50
  "@types/mysql": "^2.15.26",
51
51
  "@types/node-fetch": "^2.6.4",
52
52
  "@types/pg": "^8.11.2",
53
- "@vendure/core": "^2.3.2",
53
+ "@vendure/core": "^2.3.4",
54
54
  "mysql": "^2.18.1",
55
55
  "pg": "^8.11.3",
56
56
  "rimraf": "^5.0.5",
57
57
  "typescript": "5.3.3"
58
58
  },
59
- "gitHead": "9e88536523dbb4e2713957457c45c3d7940a456e"
59
+ "gitHead": "4f4c3ae5f5505fc475c22baebcd774c1fc5a4713"
60
60
  }
package/LICENSE DELETED
@@ -1,9 +0,0 @@
1
- The MIT License
2
-
3
- Copyright (c) 2018 Michael Bromley
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,2 +0,0 @@
1
- export declare function dirname(importMeta: any): string;
2
- export declare function filename(importMeta: any): string;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filename = exports.dirname = void 0;
4
- const path_1 = require("path");
5
- const url_1 = require("url");
6
- function dirname(importMeta) {
7
- return (0, path_1.dirname)(filename(importMeta));
8
- }
9
- exports.dirname = dirname;
10
- function filename(importMeta) {
11
- return importMeta.url ? (0, url_1.fileURLToPath)(importMeta.url) : '';
12
- }
13
- exports.filename = filename;
14
- //# sourceMappingURL=esm-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"esm-utils.js","sourceRoot":"","sources":["../../src/utils/esm-utils.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAC9C,6BAAoC;AAEpC,SAAgB,OAAO,CAAC,UAAe;IACnC,OAAO,IAAA,cAAW,EAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,0BAEC;AAED,SAAgB,QAAQ,CAAC,UAAe;IACpC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,mBAAa,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/D,CAAC;AAFD,4BAEC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Queries the database for the default Channel and returns its token.
3
- */
4
- export declare function getDefaultChannelToken(logging?: boolean): Promise<string>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDefaultChannelToken = void 0;
4
- const shared_constants_1 = require("@vendure/common/lib/shared-constants");
5
- const core_1 = require("@vendure/core");
6
- const typeorm_1 = require("typeorm");
7
- // tslint:disable:no-console
8
- // tslint:disable:no-floating-promises
9
- /**
10
- * Queries the database for the default Channel and returns its token.
11
- */
12
- async function getDefaultChannelToken(logging = true) {
13
- const connection = await typeorm_1.getConnection();
14
- let defaultChannel;
15
- try {
16
- defaultChannel = await connection.manager.getRepository(core_1.Channel).findOne({
17
- where: {
18
- code: shared_constants_1.DEFAULT_CHANNEL_CODE,
19
- },
20
- });
21
- }
22
- catch (err) {
23
- console.log(`Error occurred when attempting to get default Channel`);
24
- console.log(err);
25
- }
26
- if (!defaultChannel) {
27
- throw new Error(`No default channel could be found!`);
28
- }
29
- if (logging) {
30
- console.log(`Got default channel token: ${defaultChannel.token}`);
31
- }
32
- return defaultChannel.token;
33
- }
34
- exports.getDefaultChannelToken = getDefaultChannelToken;
35
- //# sourceMappingURL=get-default-channel-token.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-default-channel-token.js","sourceRoot":"","sources":["../../src/utils/get-default-channel-token.ts"],"names":[],"mappings":";;;AAAA,2EAA4E;AAC5E,wCAAwC;AACxC,qCAA2D;AAE3D,4BAA4B;AAC5B,sCAAsC;AACtC;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAAC,OAAO,GAAG,IAAI;IACvD,MAAM,UAAU,GAAG,MAAM,uBAAa,EAAE,CAAC;IACzC,IAAI,cAAmC,CAAC;IACxC,IAAI;QACA,cAAc,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,cAAO,CAAC,CAAC,OAAO,CAAC;YACrE,KAAK,EAAE;gBACH,IAAI,EAAE,uCAAoB;aAC7B;SACJ,CAAC,CAAC;KACN;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACpB;IACD,IAAI,CAAC,cAAc,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACzD;IACD,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,8BAA8B,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC;KACrE;IACD,OAAO,cAAc,CAAC,KAAK,CAAC;AAChC,CAAC;AApBD,wDAoBC"}