jeudi 18 août 2016

Intern JS - asynchronous hook before test definition?

I'd like to do an asynchronous action before defining my tests. For example, load a jsdom environment. When doing this, intern runs 0 tests. What would be the right way to do this? I cant do this in the config itself, as the config needs to be loaded in order for intern to find jsdom.

my intern config loads the following file:

define( [
        "intern/dojo/node!jsdom"
    ], function(
        jsdom
    )
{
    "use strict";

    var body = "";
    var scripts = [];

    jsdom.env( body, scripts, function( err, window )
    {
        define( [
            "./test_MyRenderer",
            ], function()
        {
        } );
    } );
} );

test_Renderer, defines the actual tests

define( [
        "intern!bdd",
        "intern/chai!expect",

        "src/Renderer"
    ], function(
        bdd,
        expect,

        Renderer
    )
{
"use strict";

bdd.describe( "Renderer", function()
{
    it( ...
    it( ...
} ); 

Aucun commentaire:

Enregistrer un commentaire