11import fs from "fs" ;
2+ import path from "path" ;
23import { test , expect } from "@playwright/test" ;
34import { setupDebugLog , setupProxy , resolveBinding } from "../support" ;
45
@@ -8,11 +9,9 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
89 test . beforeEach ( async ( { context } ) => {
910 setupDebugLog ( context ) ;
1011 setupProxy ( context , ( route , relativePath , mockedPath ) => {
11- if ( relativePath . match ( "error_on_load_twice.rb " ) ) {
12+ if ( relativePath . match ( "fixtures " ) ) {
1213 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 ) ,
1615 } ) ;
1716 } else if ( relativePath . match ( "redirect_to_error_on_load_twice.rb" ) ) {
1817 route . fulfill ( {
@@ -43,7 +42,7 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
4342 <script src="browser.script.iife.js"></script>
4443 <script type="text/ruby" data-eval="async">
4544 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'
4746 </script>
4847 ` ) ;
4948
@@ -61,8 +60,8 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
6160 <script src="browser.script.iife.js"></script>
6261 <script type="text/ruby" data-eval="async">
6362 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'
6665 </script>
6766 ` ) ;
6867
0 commit comments