Testing javascript with Chutzpah and requirejs

后端 未结 3 2073
天涯浪人
天涯浪人 2021-02-14 04:31

I just wonder if there is a simple tutorial showing how to test javascript in visual studio with Chutzpah, require.js and jasmine.

Basically, i want to run the tests wi

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-14 04:52

    You can find some sample codes here: https://chutzpah.codeplex.com/SourceControl/latest#Samples/RequireJS/Jasmine/tests/base/base.jasmine.test.js

    Please note if you want to use requirejs with Chutzpah and Jasmine, you need to set TestHarnessReferenceMode to AMD in chutzpah.json. Otherwise the tests won't be ran in browser.

    {
        "Framework": "jasmine",
        "TestHarnessReferenceMode": "AMD",
        "TestHarnessLocationMode": "SettingsFileAdjacent",
        "References": [
            { "Path": "require-2.1.8.js" },
            { "Path": "config.js" }
        ],
        "Tests": [
            { "Path": "tests" }
        ]
    }
    

提交回复
热议问题