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

Setup throws "no 'pages' directory found" #279

Closed
olaven opened this issue Dec 9, 2020 · 1 comment
Closed

Setup throws "no 'pages' directory found" #279

olaven opened this issue Dec 9, 2020 · 1 comment

Comments

@olaven
Copy link

olaven commented Dec 9, 2020

Hi 👋
I am attempting to use @nuxt/test-utils on a fresh nuxt-project.
However, the setup function throws with the following message:
No 'pages' directory found in <PATH-TO-MY-PROJECT>/test/fixture. Did you mean to run 'nuxt' in the parent ('../') directory?

I have tried to pass configFile and rootDir with path values relative to the test file.
Is this a bug or am I doing something wrong?

All help is greatly appreciated 😄

Here is the relevant code:

// <PATH-TO-MY-PROJECT>/test/pages/index.test.ts
import { setupTest } from '@nuxt/test-utils'

describe("The index page", () => {

    setupTest({ server: true /*, configFile: "../../nuxt.config.js", rootDir: "../../"  */});
});
// <PATH-TO-MY-PROJECT>/jest.config.ts
// jest.config.ts
import type { Config } from '@jest/types';

// Sync object
const config: Config.InitialOptions = {
    verbose: true,
    preset: "@nuxt/test-utils",
};
export default config;
This was referenced Mar 31, 2021
@ricardogobbosouza
Copy link
Collaborator

Fixed on v0.2.2

@danielroe danielroe transferred this issue from nuxt/test-utils Dec 2, 2023
@danielroe danielroe mentioned this issue Dec 2, 2023
userquin pushed a commit to userquin/test-utils that referenced this issue Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants