-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from golemfactory/feature/JST-785/esm-build
JST-785: ESM build
- Loading branch information
Showing
6 changed files
with
33 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -44,3 +44,4 @@ jobs: | |
npm run build | ||
npm install --prefix examples | ||
npm run --prefix examples lint:ts | ||
npm run test:import |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
describe("ESM Import", () => { | ||
test("Import @golem-sdk/task-executor in ESM environment", async () => { | ||
const { TaskExecutor } = await import("@golem-sdk/task-executor"); | ||
expect(typeof TaskExecutor).toBe("function"); | ||
}); | ||
}); |
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,9 @@ | ||
module.exports = { | ||
verbose: true, | ||
testEnvironment: "node", | ||
// disable transforming source files because we want to execute the | ||
// es modules directly | ||
transform: {}, | ||
moduleFileExtensions: ["js", "cjs", "mjs"], | ||
testMatch: ["**/?(*.)+(spec|test).mjs", "**/?(*.)+(spec|test).cjs"], | ||
}; |
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,6 @@ | ||
describe("CommonJS import", () => { | ||
test("Require @golem-sdk/task-executor in CJS environment", async () => { | ||
const { TaskExecutor } = require("@golem-sdk/task-executor"); | ||
expect(typeof TaskExecutor).toBe("function"); | ||
}); | ||
}); |