Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use project's root folder in runner config #32

Closed
daut opened this issue Nov 3, 2023 · 3 comments
Closed

Can't use project's root folder in runner config #32

daut opened this issue Nov 3, 2023 · 3 comments
Assignees
Labels
Type: Bug The issue has indentified a bug

Comments

@daut
Copy link

daut commented Nov 3, 2023

Package version

4.0.0

Describe the bug

Hi,

When I try to use project's root folder to set up runner config, I'm getting the following error

   ReferenceError: describe is not defined


   ⁃ Object.<anonymous>
     node_modules/json-schema-traverse/spec/index.spec.js:6
   ⁃ async importFiles
     node_modules/@japa/runner/build/index.js:151

My bin/test.js file looks like

import { assert } from '@japa/assert'
import { pathToFileURL } from 'node:url'
import { apiClient } from '@japa/api-client'
import { specReporter } from '@japa/spec-reporter'
import { processCliArgs, configure, run } from '@japa/runner'

configure({
  ...processCliArgs(process.argv.slice(2)),
  ...{
    files: ['./**/*.spec.js'],
    plugins: [assert(), apiClient('http://localhost:3333')],
    reporters: [specReporter()],
    importer: (filePath) => import(pathToFileURL(filePath).href),
  },
})

run()

Reproduction repo

No response

@thetutlage
Copy link
Contributor

What is describe? Japa does not have any method called describe

@thetutlage thetutlage self-assigned this Nov 3, 2023
@thetutlage
Copy link
Contributor

Okay, I think I get it.

The error is coming from the node_modules, so it seems like the files glob is reading and importing files from node_modules as well.

I think, we will need a way to ignore certain directories. I will fix it

@thetutlage thetutlage added the Type: Bug The issue has indentified a bug label Nov 3, 2023
@thetutlage
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue has indentified a bug
Projects
None yet
Development

No branches or pull requests

2 participants