Skip to content

Commit

Permalink
Reenable TestNewJSRunnerWithCustomModule
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Apr 7, 2021
1 parent e12a444 commit 2f13438
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/init_and_modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ package js_test

import (
"context"
"fmt"
"net/url"
"sync/atomic"
"testing"
"time"

Expand Down Expand Up @@ -59,20 +61,23 @@ func (cm *CheckModule) VuCtx(ctx context.Context) {
assert.NotNil(cm.t, lib.GetState(ctx))
}

var uniqueModuleNumber int64 //nolint:gochecknoglobals

func TestNewJSRunnerWithCustomModule(t *testing.T) {
t.Skip()
t.Parallel()
checkModule := &CheckModule{t: t}
modules.Register("k6/check", checkModule)
moduleName := fmt.Sprintf("k6/check-%d", atomic.AddInt64(&uniqueModuleNumber, 1))
modules.Register(moduleName, checkModule)

script := `
var check = require("k6/check");
script := fmt.Sprintf(`
var check = require("%s");
check.initCtx();
module.exports.options = { vus: 1, iterations: 1 };
module.exports.default = function() {
check.vuCtx();
};
`
`, moduleName)

logger := testutils.NewLogger(t)
rtOptions := lib.RuntimeOptions{CompatibilityMode: null.StringFrom("base")}
Expand Down

0 comments on commit 2f13438

Please sign in to comment.