@jsenv/core 32.2.3 → 32.2.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
@@ -7,7 +7,7 @@ It has naturally evolved to cover the core needs of a JavaScript project: develo
7
7
  - :sparkles: Same tooling for dev, tests and build.
8
8
  - :exploding_head: Can execute tests on Chrome, Firefox, Safari and Node.js.
9
9
 
10
- [Documentation](https://github.com/jsenv/jsenv-core/wiki)
10
+ [Documentation](https://github.com/jsenv/jsenv-core/wiki/A\)-Getting-started)
11
11
 
12
12
  # Installation
13
13
 
package/dist/jsenv.js CHANGED
@@ -23018,6 +23018,7 @@ const pingServer = async url => {
23018
23018
  };
23019
23019
 
23020
23020
  const basicFetch = async (url, {
23021
+ rejectUnauthorized = true,
23021
23022
  method = "GET",
23022
23023
  headers = {}
23023
23024
  } = {}) => {
@@ -23033,6 +23034,7 @@ const basicFetch = async (url, {
23033
23034
  const urlObject = new URL(url);
23034
23035
  return new Promise((resolve, reject) => {
23035
23036
  const req = request({
23037
+ rejectUnauthorized,
23036
23038
  hostname: urlObject.hostname,
23037
23039
  port: urlObject.port,
23038
23040
  path: urlObject.pathname,
@@ -24713,7 +24715,9 @@ const executeTestPlan = async ({
24713
24715
  }
24714
24716
  const {
24715
24717
  sourceDirectoryUrl
24716
- } = await basicFetch(`${devServerOrigin}/__server_params__.json`);
24718
+ } = await basicFetch(`${devServerOrigin}/__server_params__.json`, {
24719
+ rejectUnauthorized: false
24720
+ });
24717
24721
  if (testDirectoryUrl !== sourceDirectoryUrl && !urlIsInsideOf(testDirectoryUrl, sourceDirectoryUrl)) {
24718
24722
  throw new Error(`testDirectoryUrl must be inside sourceDirectoryUrl when running tests on browser(s)`);
24719
24723
  }
@@ -24833,7 +24837,9 @@ const executeTestPlan = async ({
24833
24837
  });
24834
24838
  if (stopDevServerNeeded) {
24835
24839
  // we are expecting ECONNRESET because server will be stopped by the request
24836
- basicFetch(`${devServerOrigin}/__stop__`).catch(e => {
24840
+ basicFetch(`${devServerOrigin}/__stop__`, {
24841
+ rejectUnauthorized: false
24842
+ }).catch(e => {
24837
24843
  if (e.code === "ECONNRESET") {
24838
24844
  return;
24839
24845
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "32.2.3",
3
+ "version": "32.2.4",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  export const basicFetch = async (
2
2
  url,
3
- { method = "GET", headers = {} } = {},
3
+ { rejectUnauthorized = true, method = "GET", headers = {} } = {},
4
4
  ) => {
5
5
  let requestModule
6
6
  if (url.startsWith("http:")) {
@@ -14,6 +14,7 @@ export const basicFetch = async (
14
14
 
15
15
  return new Promise((resolve, reject) => {
16
16
  const req = request({
17
+ rejectUnauthorized,
17
18
  hostname: urlObject.hostname,
18
19
  port: urlObject.port,
19
20
  path: urlObject.pathname,
@@ -166,6 +166,7 @@ export const executeTestPlan = async ({
166
166
  }
167
167
  const { sourceDirectoryUrl } = await basicFetch(
168
168
  `${devServerOrigin}/__server_params__.json`,
169
+ { rejectUnauthorized: false },
169
170
  )
170
171
  if (
171
172
  testDirectoryUrl !== sourceDirectoryUrl &&
@@ -336,7 +337,9 @@ export const executeTestPlan = async ({
336
337
  })
337
338
  if (stopDevServerNeeded) {
338
339
  // we are expecting ECONNRESET because server will be stopped by the request
339
- basicFetch(`${devServerOrigin}/__stop__`).catch((e) => {
340
+ basicFetch(`${devServerOrigin}/__stop__`, {
341
+ rejectUnauthorized: false,
342
+ }).catch((e) => {
340
343
  if (e.code === "ECONNRESET") {
341
344
  return
342
345
  }