This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree 2 files changed +0
-26
lines changed
2 files changed +0
-26
lines changed Original file line number Diff line number Diff line change 2
2
package browser
3
3
4
4
import (
5
- "errors"
6
- "os"
7
-
8
5
"github.com/dop251/goja"
9
6
10
7
"github.com/grafana/xk6-browser/common"
11
8
"github.com/grafana/xk6-browser/k6ext"
12
9
13
- k6common "go.k6.io/k6/js/common"
14
10
k6modules "go.k6.io/k6/js/modules"
15
11
)
16
12
@@ -47,15 +43,6 @@ func New() *RootModule {
47
43
// NewModuleInstance implements the k6modules.Module interface to return
48
44
// a new instance for each VU.
49
45
func (* RootModule ) NewModuleInstance (vu k6modules.VU ) k6modules.Instance {
50
- if _ , ok := os .LookupEnv ("K6_BROWSER_DISABLE_RUN" ); ok {
51
- msg := "Disable run flag enabled, browser test run aborted. Please contact support."
52
- if m , ok := os .LookupEnv ("K6_BROWSER_DISABLE_RUN_MSG" ); ok {
53
- msg = m
54
- }
55
-
56
- k6common .Throw (vu .Runtime (), errors .New (msg ))
57
- }
58
-
59
46
// promises and inner objects need the VU object to be
60
47
// able to use k6-core specific functionality.
61
48
ctx := k6ext .WithVU (vu .Context (), vu )
Original file line number Diff line number Diff line change 5
5
"testing"
6
6
7
7
"github.com/dop251/goja"
8
- "github.com/stretchr/testify/assert"
9
8
"github.com/stretchr/testify/require"
10
9
11
10
k6common "go.k6.io/k6/js/common"
@@ -33,15 +32,3 @@ func TestModuleNew(t *testing.T) {
33
32
require .NotNil (t , m .mod .Devices , "Devices should be set" )
34
33
require .Equal (t , version , m .mod .Version , "Incorrect version" )
35
34
}
36
-
37
- func TestModuleNewDisabled (t * testing.T ) {
38
- t .Setenv ("K6_BROWSER_DISABLE_RUN" , "" )
39
-
40
- vu := & k6modulestest.VU {
41
- RuntimeField : goja .New (),
42
- InitEnvField : & k6common.InitEnvironment {
43
- Registry : k6metrics .NewRegistry (),
44
- },
45
- }
46
- assert .Panics (t , func () { New ().NewModuleInstance (vu ) })
47
- }
You can’t perform that action at this time.
0 commit comments