Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify sbt output parsing to allow .sbtopts with modified output #20

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dev: extract vars for path + normalized
Michael Kaleja committed Dec 13, 2023
commit c7040cd4602a6dcaad3873c84a1dc5deb324e08e
20 changes: 16 additions & 4 deletions test/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -52,7 +52,10 @@ describe("scalaJSPlugin", () => {
await plugin.configResolved.call(undefined, { mode: MODE_PRODUCTION });
await plugin.buildStart.call(fakePluginContext, {});

expect(normalizeSlashes(await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js')))
const path = await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js');
const normalized = normalizeSlashes(path);

expect(normalized)
.toContain('/testproject/target/scala-3.2.2/testproject-opt/main.js');

expect(await plugin.resolveId.call(fakePluginContext, 'scalajs/main.js'))
@@ -65,7 +68,10 @@ describe("scalaJSPlugin", () => {
await plugin.configResolved.call(undefined, { mode: MODE_DEVELOPMENT });
await plugin.buildStart.call(fakePluginContext, {});

expect(normalizeSlashes(await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js')))
const path = await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js');
const normalized = normalizeSlashes(path);

expect(normalized)
.toContain('/testproject/target/scala-3.2.2/testproject-fastopt/main.js');

expect(await plugin.resolveId.call(fakePluginContext, 'scalajs/main.js'))
@@ -80,7 +86,10 @@ describe("scalaJSPlugin", () => {
await plugin.configResolved.call(undefined, { mode: MODE_PRODUCTION });
await plugin.buildStart.call(fakePluginContext, {});

expect(normalizeSlashes(await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js')))
const path = await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js');
const normalized = normalizeSlashes(path);

expect(normalized)
.toContain('/testproject/other-project/target/scala-3.2.2/otherproject-opt/main.js');

expect(await plugin.resolveId.call(fakePluginContext, 'scalajs/main.js'))
@@ -95,7 +104,10 @@ describe("scalaJSPlugin", () => {
await plugin.configResolved.call(undefined, { mode: MODE_DEVELOPMENT });
await plugin.buildStart.call(fakePluginContext, {});

expect(normalizeSlashes(await plugin.resolveId.call(fakePluginContext, 'customsjs:main.js')))
const path = await plugin.resolveId.call(fakePluginContext, 'customsjs:main.js');
const normalized = normalizeSlashes(path);

expect(normalized)
.toContain('/testproject/target/scala-3.2.2/testproject-fastopt/main.js');

expect(await plugin.resolveId.call(fakePluginContext, 'scalajs:main.js'))