admin管理员组

文章数量:1291125

I have simple test automation project with TypeScript + Vitest + allure-vitest reporter. I have tried to upgrade/downgrade main dependencies without any luck.

It works perfectly on one type of machine (laptop Windows 11), but failed to run on some virtual Windows machine. Node installation, dependencies are the identical. We even tried to copy whole Node and NPM folders to the virtual machine.

The problem is, that for code like the following:

describe('Hello Suite', async function () {
  it.only(`Hello TestCase`, async function () {
 
        await allure.step(`Execute step`, async (step) => {
            console.log('Test Step')
        })
        console.log('Done')
    })
})

We are getting

Error: Vitest failed to find the current suite. This is a bug in Vitest. Please, open an issue with reproduction.
❯ VitestTestRuntime.sendMessage ...../node_modules/allure-vitest/src/VitestTestRuntime.ts:13:26
❯ ../../../../Dev/...../node_modules/allure-js-commons/src/sdk/runtime/MessageTestRuntime.ts:166:16

I already checked the GitHub Vitest page, it states, that problem is with compilation of code outside of Vitest. I guess with allure-reporter.

It's true, if we remove allure from test, it runs. I am not sure, how to debug this problem. I even could not find the VitestTestRuntime.ts file to drill in.

local
+-- @types/[email protected]
+-- @types/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

global
-- [email protected]
+-- [email protected]
`-- [email protected]

My questions are:

  • How to debug such problem?
  • What else can I try?

I have simple test automation project with TypeScript + Vitest + allure-vitest reporter. I have tried to upgrade/downgrade main dependencies without any luck.

It works perfectly on one type of machine (laptop Windows 11), but failed to run on some virtual Windows machine. Node installation, dependencies are the identical. We even tried to copy whole Node and NPM folders to the virtual machine.

The problem is, that for code like the following:

describe('Hello Suite', async function () {
  it.only(`Hello TestCase`, async function () {
 
        await allure.step(`Execute step`, async (step) => {
            console.log('Test Step')
        })
        console.log('Done')
    })
})

We are getting

Error: Vitest failed to find the current suite. This is a bug in Vitest. Please, open an issue with reproduction.
❯ VitestTestRuntime.sendMessage ...../node_modules/allure-vitest/src/VitestTestRuntime.ts:13:26
❯ ../../../../Dev/...../node_modules/allure-js-commons/src/sdk/runtime/MessageTestRuntime.ts:166:16

I already checked the GitHub Vitest page, it states, that problem is with compilation of code outside of Vitest. I guess with allure-reporter.

It's true, if we remove allure from test, it runs. I am not sure, how to debug this problem. I even could not find the VitestTestRuntime.ts file to drill in.

local
+-- @types/[email protected]
+-- @types/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

global
-- [email protected]
+-- [email protected]
`-- [email protected]

My questions are:

  • How to debug such problem?
  • What else can I try?
Share Improve this question edited Feb 18 at 12:31 Mark Rotteveel 109k229 gold badges156 silver badges220 bronze badges asked Feb 13 at 19:41 user1411968user1411968 192 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Try to add @vitest/runner to the package.json with the same version as the version of vitest.

You can also check the globally installed NPM packages in your Vitrual Win environment. Some of them may affect the behaviour.

If nothing helps, I recommend trying to use Yarn PNP (with global cache disabled) instead of NPM—it will help isolate the environment. The official examples anisation has an example of Using Allure Vitest with Yarn PNP.

本文标签: nodejsHow to debug configuration issue with allurevitestreporterStack Overflow