Skip to content

Commit

Permalink
Modifying the test code to make it less misleading
Browse files Browse the repository at this point in the history
  • Loading branch information
ledsun committed Aug 12, 2024
1 parent 2c36e1f commit 2e91b63
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
expect(await resolve()).toBe("Hello from RecursiveRequire::B");
});

test("JS::RequireRemote#load loads a file with a relative path from base_url option", async ({
test("JS::RequireRemote#load loads the file with a path relative to the base_url specified by the base_url property.", async ({
page
}) => {
const resolve = await resolveBinding(page, "checkResolved");
Expand All @@ -127,12 +127,13 @@ if (!process.env.RUBY_NPM_PACKAGE_ROOT) {
<script src="browser.script.iife.js"></script>
<script type="text/ruby" data-eval="async">
require 'js/require_remote'
JS::RequireRemote.instance.base_url = 'fixtures'
JS.global.checkResolved JS::RequireRemote.instance.load 'error_on_load_twice'
JS::RequireRemote.instance.base_url = 'fixtures/recursive_require'
JS::RequireRemote.instance.load 'b'
JS.global.checkResolved RecursiveRequire::B.new.message
</script>
`);

expect(await resolve()).toBe(true);
expect(await resolve()).toBe("Hello from RecursiveRequire::B");
});
});
}

0 comments on commit 2e91b63

Please sign in to comment.