fix(test-utils): detect project root using nuxt.config with .mjs and .cjs extensions (#8855)

* fix(test-util): fix `.mjs` config file edge case

* Update packages/test-utils/src/nuxt.ts

Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
Horu 2022-11-10 15:43:32 +07:00 committed by GitHub
parent 8d30e97b91
commit 62bbb91446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,8 @@ const isNuxtApp = (dir: string) => {
return existsSync(dir) && (
existsSync(resolve(dir, 'pages')) ||
existsSync(resolve(dir, 'nuxt.config.js')) ||
existsSync(resolve(dir, 'nuxt.config.mjs')) ||
existsSync(resolve(dir, 'nuxt.config.cjs')) ||
existsSync(resolve(dir, 'nuxt.config.ts'))
)
}