poku 3.0.1 → 3.0.2-canary.267624e

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.
@@ -12,7 +12,7 @@ exports.results = {
12
12
  skipped: 0,
13
13
  todo: 0,
14
14
  };
15
- exports.VERSION = '3.0.1';
15
+ exports.VERSION = '3.0.2-canary.267624e';
16
16
  exports.deepOptions = [];
17
17
  exports.GLOBAL = {
18
18
  cwd: (0, node_process_1.cwd)(),
@@ -111,11 +111,11 @@ const backgroundProcess = (runtime, args, file, options) => new Promise((resolve
111
111
  catch { }
112
112
  });
113
113
  /** Starts a file in a background process (useful for servers, APIs, etc.) */
114
- const startService = async (file, options) => {
114
+ const startService = (file, options) => {
115
115
  const runtimeOptions = (0, get_runner_js_1.runner)(file);
116
116
  const runtime = runtimeOptions.shift();
117
117
  const runtimeArgs = [...runtimeOptions, file];
118
- return await backgroundProcess(runtime, runtimeArgs, (0, node_path_1.normalize)((0, list_files_js_1.sanitizePath)(file)), options);
118
+ return backgroundProcess(runtime, runtimeArgs, (0, node_path_1.normalize)((0, list_files_js_1.sanitizePath)(file)), options);
119
119
  };
120
120
  exports.startService = startService;
121
121
  /**
@@ -126,12 +126,12 @@ exports.startService = startService;
126
126
  *
127
127
  * By default it uses **npm**, but you can costumize it using the `runner` option.
128
128
  */
129
- const startScript = async (script, options) => {
129
+ const startScript = (script, options) => {
130
130
  const runner = options?.runner ?? 'npm';
131
131
  const runtimeOptions = (0, get_runner_js_1.scriptRunner)(runner);
132
132
  const runtime = runtimeOptions.shift();
133
133
  const runtimeArgs = [...runtimeOptions, script];
134
- return await backgroundProcess(runtime, runtimeArgs, script, {
134
+ return backgroundProcess(runtime, runtimeArgs, script, {
135
135
  ...options,
136
136
  runner,
137
137
  });
@@ -13,9 +13,9 @@ const getPIDsByPorts = async (port) => {
13
13
  }));
14
14
  return PIDs;
15
15
  };
16
- const getPIDsByRange = async (startsAt, endsAt) => {
16
+ const getPIDsByRange = (startsAt, endsAt) => {
17
17
  const ports = (0, pid_js_1.populateRange)(startsAt, endsAt);
18
- return await (0, exports.getPIDs)(ports);
18
+ return (0, exports.getPIDs)(ports);
19
19
  };
20
20
  /** Returns an array containing the ID of all processes listening to the specified port */
21
21
  exports.getPIDs = Object.assign(getPIDsByPorts, {
@@ -38,7 +38,7 @@ const getAllFiles = async (dirPath, files = new Set(), configs) => {
38
38
  isFullPath = true;
39
39
  return [(0, exports.sanitizePath)(dirPath)];
40
40
  }
41
- return await (0, promises_1.readdir)((0, exports.sanitizePath)(dirPath));
41
+ return (0, promises_1.readdir)((0, exports.sanitizePath)(dirPath));
42
42
  }
43
43
  catch (error) {
44
44
  console.error(error);
@@ -40,7 +40,7 @@ class DockerContainer {
40
40
  args.push('--no-cache');
41
41
  await runDockerCommand('docker', [...args, '-t', this.tagName, '-f', this.file, this.context], { cwd: this.cwd }, this.verbose);
42
42
  }
43
- async start() {
43
+ start() {
44
44
  const args = ['run'];
45
45
  args.push(this.detach !== false ? '-d' : '--init');
46
46
  args.push(...['--name', this.containerName]);
@@ -50,10 +50,10 @@ class DockerContainer {
50
50
  args.push(...['-e', environment]);
51
51
  if (this.envFile)
52
52
  args.push(...['--env-file', this.envFile]);
53
- return await runDockerCommand('docker', [...args, this.tagName], { cwd: this.cwd }, this.verbose);
53
+ return runDockerCommand('docker', [...args, this.tagName], { cwd: this.cwd }, this.verbose);
54
54
  }
55
- async stop() {
56
- return await runDockerCommand('docker', ['stop', this.containerName], { cwd: this.cwd }, this.verbose);
55
+ stop() {
56
+ return runDockerCommand('docker', ['stop', this.containerName], { cwd: this.cwd }, this.verbose);
57
57
  }
58
58
  async remove() {
59
59
  await runDockerCommand('docker', ['rm', '-f', this.containerName], { cwd: this.cwd }, this.verbose);
@@ -73,7 +73,7 @@ class DockerCompose {
73
73
  this.cwd = cwd ? (0, list_files_js_1.sanitizePath)(cwd) : undefined;
74
74
  this.verbose = verbose;
75
75
  }
76
- async up() {
76
+ up() {
77
77
  const args = ['compose', '-f', this.file];
78
78
  if (this.envFile)
79
79
  args.push(...['--env-file', this.envFile]);
@@ -85,15 +85,15 @@ class DockerCompose {
85
85
  args.push('--build');
86
86
  if (this.serviceName)
87
87
  args.push(this.serviceName);
88
- return await runDockerCommand('docker', args, { cwd: this.cwd }, this.verbose);
88
+ return runDockerCommand('docker', args, { cwd: this.cwd }, this.verbose);
89
89
  }
90
- async down() {
90
+ down() {
91
91
  const args = ['-f', this.file];
92
92
  if (this.envFile)
93
93
  args.push(...['--env-file', this.envFile]);
94
94
  if (this.projectName)
95
95
  args.push(...['-p', this.projectName]);
96
- return await runDockerCommand('docker', ['compose', ...args, 'down'], { cwd: this.cwd }, this.verbose);
96
+ return runDockerCommand('docker', ['compose', ...args, 'down'], { cwd: this.cwd }, this.verbose);
97
97
  }
98
98
  }
99
99
  exports.DockerCompose = DockerCompose;
@@ -1,2 +1,2 @@
1
- export declare const beforeEach: (fileRelative: string) => Promise<boolean>;
2
- export declare const afterEach: (fileRelative: string) => Promise<boolean>;
1
+ export declare const beforeEach: (fileRelative: string) => true | Promise<boolean>;
2
+ export declare const afterEach: (fileRelative: string) => true | Promise<boolean>;
@@ -34,15 +34,15 @@ const eachCore = async (type, fileRelative) => {
34
34
  return false;
35
35
  }
36
36
  };
37
- const beforeEach = async (fileRelative) => {
37
+ const beforeEach = (fileRelative) => {
38
38
  if (poku_js_1.GLOBAL.configs.beforeEach)
39
- return await eachCore('beforeEach', fileRelative);
39
+ return eachCore('beforeEach', fileRelative);
40
40
  return true;
41
41
  };
42
42
  exports.beforeEach = beforeEach;
43
- const afterEach = async (fileRelative) => {
43
+ const afterEach = (fileRelative) => {
44
44
  if (poku_js_1.GLOBAL.configs.afterEach)
45
- return await eachCore('afterEach', fileRelative);
45
+ return eachCore('afterEach', fileRelative);
46
46
  return true;
47
47
  };
48
48
  exports.afterEach = afterEach;
@@ -65,6 +65,6 @@ const runTests = async (dir) => {
65
65
  };
66
66
  for (let i = 0; i < concurrency; i++)
67
67
  isSequential ? await runNext() : runNext();
68
- return await done;
68
+ return done;
69
69
  };
70
70
  exports.runTests = runTests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poku",
3
- "version": "3.0.1",
3
+ "version": "3.0.2-canary.267624e",
4
4
  "description": "🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.",
5
5
  "main": "./lib/modules/index.js",
6
6
  "license": "MIT",