generated from react18-tools/turborepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for dist directory and cleanup dependencies
- Loading branch information
1 parent
9d32da9
commit 5135f28
Showing
5 changed files
with
38 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
import { describe, test } from "vitest"; | ||
|
||
/** testing tsup example (packages/shared) - make sure it is build before running this test suit | ||
* | ||
* These tests are not included in coverage as they do not invoke the source code directly. However, these tests are very important to ensure that the build outputs in dist directory are behaving as expected. | ||
*/ | ||
describe.concurrent("Test plugin with default options in example build with tsup", () => { | ||
const exampleBuildDir = path.resolve(process.cwd(), "..", "packages", "shared", "dist"); | ||
|
||
test("Should not contain duplicate require statements for a library", ({ expect }) => { | ||
const text = fs.readFileSync(path.resolve(exampleBuildDir, "index.js"), "utf-8"); | ||
expect(text.match(/['"]react['"]/)?.length).toBe(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.