1
1
import fs from "fs" ;
2
+ import path from "path" ;
2
3
import { test , expect } from "@playwright/test" ;
3
4
import { setupDebugLog , setupProxy , resolveBinding } from "../support" ;
4
5
@@ -8,11 +9,9 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
8
9
test . beforeEach ( async ( { context } ) => {
9
10
setupDebugLog ( context ) ;
10
11
setupProxy ( context , ( route , relativePath , mockedPath ) => {
11
- if ( relativePath . match ( "error_on_load_twice.rb " ) ) {
12
+ if ( relativePath . match ( "fixtures " ) ) {
12
13
route . fulfill ( {
13
- body : `raise 'load twice' if defined? ALREADY_LOADED
14
- ALREADY_LOADED = true` ,
15
- contentType : "text/ruby" ,
14
+ path : path . join ( "./test-e2e/integrations" , relativePath ) ,
16
15
} ) ;
17
16
} else if ( relativePath . match ( "redirect_to_error_on_load_twice.rb" ) ) {
18
17
route . fulfill ( {
@@ -43,7 +42,7 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
43
42
<script src="browser.script.iife.js"></script>
44
43
<script type="text/ruby" data-eval="async">
45
44
require 'js/require_remote'
46
- JS.global.checkResolved JS::RequireRemote.instance.load 'error_on_load_twice'
45
+ JS.global.checkResolved JS::RequireRemote.instance.load 'fixtures/ error_on_load_twice'
47
46
</script>
48
47
` ) ;
49
48
@@ -61,8 +60,8 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
61
60
<script src="browser.script.iife.js"></script>
62
61
<script type="text/ruby" data-eval="async">
63
62
require 'js/require_remote'
64
- JS::RequireRemote.instance.load 'error_on_load_twice'
65
- JS.global.checkResolved JS::RequireRemote.instance.load 'error_on_load_twice'
63
+ JS::RequireRemote.instance.load 'fixtures/ error_on_load_twice'
64
+ JS.global.checkResolved JS::RequireRemote.instance.load 'fixtures/ error_on_load_twice'
66
65
</script>
67
66
` ) ;
68
67
0 commit comments