Testing 选项没有';不适用于跑步者

Testing 选项没有';不适用于跑步者,testing,automation,automated-tests,e2e-testing,testcafe,Testing,Automation,Automated Tests,E2e Testing,Testcafe,我正在尝试在隔离模式下运行一个简单的测试: test.only(“test”,async t=>{ 等待t.expect(真); }); 这是我的跑步者 const createTestCafe = require("testcafe"); let testcafe = null; const runTests = (testFiles) => { const runner = testcafe.createRunner(); return runner .src(testFi

我正在尝试在隔离模式下运行一个简单的测试:

test.only(“test”,async t=>{
等待t.expect(真);
});

这是我的跑步者

const createTestCafe = require("testcafe");

let testcafe = null;

const runTests = (testFiles) => {
const runner = testcafe.createRunner();
  return runner
  .src(testFiles)
  .browsers(["chrome"])
  .run({
    quarantineMode: true
  });
};

createTestCafe("localhost", 1337, 1338)
  .then(tc => {
   testcafe = tc;
   return runTests(["src/tests/"])
})
.then(() => testcafe.close());

但测试仍然只运行一次。我还尝试在package.json文件附近添加配置文件,在runner文件附近添加配置文件,但仍然没有结果。

我将代码复制到“run.js”文件中运行TestCafe,然后修改测试代码,如下所示:

fixture`fixture`;
test.only(“test”,异步t=>{
console.log('test');
等待t.expect(真);
});
之后,我在终端中运行
节点run.js
命令。我得到了下面的测试执行报告


您可以看到
test
单词在测试执行报告中出现了3次。因此,测试将运行3次,TestCafe的隔离模式按预期工作。

是的,谢谢,在如此快速的测试中测试它是个坏主意