【问题标题】:How to add Jasmine settings to a "standalone" Jasmine setup (one using SpecRunner.html)如何将 Jasmine 设置添加到“独立”Jasmine 设置(使用 SpecRunner.html 的设置)
【发布时间】:2018-07-02 09:20:04
【问题描述】:

网上有很多关于如何在 SpecRunner.html 文件中设置独立 jasmine 测试的示例,如下所示:

<!doctype html>
<html>
<head>
    <title>Jasmine Spec Runner</title>
    <link rel="stylesheet" href="bower_components/jasmine/lib/jasmine-core/jasmine.css">
</head>
<body>
    <script src="bower_components/jasmine/lib/jasmine-core/jasmine.js"></script>
    <script src="bower_components/jasmine/lib/jasmine-core/jasmine-html.js"></script>

    <!-- include source files here... -->
    <!-- include spec files here... -->

通过这种设置,我将如何配置 Jasmine 设置,例如 node.jsgulp 设置中的设置?我说的是random: false、设置随机种子以及其他非特定于跑步者的设置。

【问题讨论】:

    标签: javascript jasmine


    【解决方案1】:

    在请求页面时,设置似乎是通过 URL 参数传入的。我通过页面右上角的“选项”框发现了其中一些:

    这是我能找到的参数列表(我不确定这是不是全部):

    • random=true
    • throwFailures=true
    • failFast=true
    • seed=87816

    这是一个示例请求,具有上述设置:

    GET localhost:8080/SpecRunner.html?random=true&throwFailures=true&failFast=true&seed=87816
    

    【讨论】:

      猜你喜欢
      • 2011-12-05
      • 2012-12-04
      • 1970-01-01
      • 2014-09-30
      • 2023-03-22
      • 2015-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多