如何强制依次运行ZIO测试

时间:2020-01-08 09:53:48

标签: scala integration-testing zio zio-test

我想依次运行两个集成测试。如何在 ZIO测试中实现?

这是套房:

suite("Undeploy a Package")(
    testM("There is a Package") {
      PackageDeployer.deploy(pckg) *> // first deploy
        assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NoContent))
    },
    testM(s"There is no Package") {
        assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NotFound))
    })

ZIO测试并行运行两个测试。有没有办法强制它们按顺序运行?

1 个答案:

答案 0 :(得分:8)

是的!您可以为此使用// Creating an array of numbers var ti = new List<int> { 1, 2, 3 }; // Prepend and Append any value of the same type var results = ti.Prepend(0).Append(4); // output is 0, 1, 2, 3, 4 Console.WriteLine(string.Join(", ", results ));

TestAspect.sequential
相关问题