Skip to content

Fix getEmitOutDir not using project root if no outDir is provided#1038

Merged
Perryvw merged 2 commits into
masterfrom
bugfix/emitoutdir
Jun 21, 2021
Merged

Fix getEmitOutDir not using project root if no outDir is provided#1038
Perryvw merged 2 commits into
masterfrom
bugfix/emitoutdir

Conversation

@Perryvw

@Perryvw Perryvw commented Jun 20, 2021

Copy link
Copy Markdown
Member

Fixes #1036

@Perryvw Perryvw requested a review from lolleko June 20, 2021 10:34
Comment thread test/transpile/paths.spec.ts Outdated
});
});

describe("getEmitOutDir", () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant? Already tested via getEmitPath tests?

Comment thread test/transpile/paths.spec.ts Outdated
const { transpiledFiles } = util.testModule``
.setMainFileName("main.ts")
.addExtraFile("dir/extra.ts", "")
.setOptions({ outDir: path.join(cwd, "tstl-out") })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a var for path.join(cwd, "tstl-out") that can be reused in the asserts below.

Comment thread test/transpile/paths.spec.ts Outdated
const { transpiledFiles } = util.testModule``
.setMainFileName("src/main.ts")
.addExtraFile("src/extra.ts", "")
.setOptions({ rootDir: "src", outDir: path.join(cwd, "tstl-out") })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above code duplication path.join(cwd, "tstl-out")

@Perryvw Perryvw merged commit 8d9c8af into master Jun 21, 2021
@Perryvw Perryvw deleted the bugfix/emitoutdir branch June 21, 2021 20:06
sanikoyes pushed a commit to sanikoyes/TypeScriptToLua that referenced this pull request Sep 24, 2021
…peScriptToLua#1038)

* Fix getEmitOutDir not using project root if no outDir is provided

* Removed redundant tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundle output path is relative to source dir instead of projectRoot, if no rootDir is provided

2 participants