@japa/runner 2.0.4 → 2.0.7

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/build/index.js CHANGED
@@ -140,6 +140,7 @@ function isSuiteAllowed(name, filters) {
140
140
  */
141
141
  function configure(options) {
142
142
  const defaultOptions = {
143
+ cwd: process.cwd(),
143
144
  files: [],
144
145
  suites: [],
145
146
  plugins: [],
@@ -148,7 +149,7 @@ function configure(options) {
148
149
  filters: {},
149
150
  setup: [],
150
151
  teardown: [],
151
- importer: (filePath) => (0, inclusion_1.default)(filePath),
152
+ importer: (filePath) => (0, inclusion_1.default)((0, url_1.pathToFileURL)(filePath).href),
152
153
  refiner: new core_1.Refiner({}),
153
154
  forceExit: false,
154
155
  configureSuite: () => { },
@@ -219,7 +220,7 @@ test.group = function (title, callback) {
219
220
  */
220
221
  async function collectFiles(files) {
221
222
  if (Array.isArray(files) || typeof files === 'string') {
222
- return await (0, fast_glob_1.default)(files, { absolute: true, onlyFiles: true });
223
+ return await (0, fast_glob_1.default)(files, { absolute: true, onlyFiles: true, cwd: runnerOptions.cwd });
223
224
  }
224
225
  else if (typeof files === 'function') {
225
226
  return await files();
@@ -235,11 +236,11 @@ async function importFiles(files) {
235
236
  recentlyImportedFile = file;
236
237
  if (runnerOptions.filters.files && runnerOptions.filters.files.length) {
237
238
  if (isFileAllowed(file, runnerOptions.filters.files)) {
238
- await runnerOptions.importer((0, url_1.pathToFileURL)(file).href);
239
+ await runnerOptions.importer(file);
239
240
  }
240
241
  }
241
242
  else {
242
- await runnerOptions.importer((0, url_1.pathToFileURL)(file).href);
243
+ await runnerOptions.importer(file);
243
244
  }
244
245
  }
245
246
  }
@@ -395,6 +396,7 @@ function processCliArgs(argv) {
395
396
  };
396
397
  processAsString(parsed, 'tags', (tags) => (config.filters.tags = tags));
397
398
  processAsString(parsed, 'ignoreTags', (tags) => {
399
+ config.filters.tags = config.filters.tags || [];
398
400
  tags.forEach((tag) => config.filters.tags.push(`!${tag}`));
399
401
  });
400
402
  processAsString(parsed, 'groups', (groups) => (config.filters.groups = groups));
@@ -34,6 +34,7 @@ export declare type RunnerHooks = {
34
34
  * Base configuration options
35
35
  */
36
36
  export declare type BaseConfig = {
37
+ cwd?: string;
37
38
  timeout?: number;
38
39
  plugins?: PluginFn[];
39
40
  filters?: Filters;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@japa/runner",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "description": "Runner for Japa testing framework",
5
5
  "main": "build/index.js",
6
6
  "files": [
@@ -35,22 +35,22 @@
35
35
  "license": "MIT",
36
36
  "devDependencies": {
37
37
  "@adonisjs/mrm-preset": "^5.0.3",
38
- "@adonisjs/require-ts": "^2.0.10",
39
- "@types/node": "^17.0.22",
38
+ "@adonisjs/require-ts": "^2.0.11",
39
+ "@types/node": "^17.0.23",
40
40
  "commitizen": "^4.2.4",
41
41
  "cz-conventional-changelog": "^3.3.0",
42
42
  "del-cli": "^4.0.1",
43
- "eslint": "^8.11.0",
43
+ "eslint": "^8.12.0",
44
44
  "eslint-config-prettier": "^8.5.0",
45
45
  "eslint-plugin-adonis": "^2.1.0",
46
46
  "eslint-plugin-prettier": "^4.0.0",
47
- "github-label-sync": "^2.0.2",
47
+ "github-label-sync": "^2.2.0",
48
48
  "husky": "^7.0.4",
49
49
  "japa": "^4.0.0",
50
50
  "mrm": "^4.0.0",
51
51
  "np": "^7.6.1",
52
- "prettier": "^2.6.0",
53
- "typescript": "^4.6.2"
52
+ "prettier": "^2.6.2",
53
+ "typescript": "^4.6.3"
54
54
  },
55
55
  "mrmConfig": {
56
56
  "core": false,
@@ -105,8 +105,8 @@
105
105
  "anyBranch": false
106
106
  },
107
107
  "dependencies": {
108
- "@japa/core": "^6.0.2",
109
- "@japa/errors-printer": "^1.3.5",
108
+ "@japa/core": "^6.0.4",
109
+ "@japa/errors-printer": "^1.3.7",
110
110
  "@poppinss/hooks": "^6.0.2-0",
111
111
  "fast-glob": "^3.2.11",
112
112
  "getopts": "^2.3.0",