Commit Graph

17 Commits

Author SHA1 Message Date
Branden Cash 506fd53fb1
test: type the @actions/core spy/mock from the actual implementations
This allows the mockImplementation calls to automatically be typed based on the official @actions/core type definitions rather than having to define them manually.

Signed-off-by: Branden Cash <branden.cash@parchment.com>
2024-02-22 08:00:38 -07:00
Nick Alteen 51bc172a7a Reset mocks on each test 2023-11-01 13:43:25 -04:00
GrantBirki bbc4f562cd
jest.spyOn GitHub core methods to clean up the test output 2023-10-31 17:26:02 -06:00
Nick Alteen 03da66625b Switch entrypoint and main functionality 2023-09-11 15:54:30 -04:00
Nick Alteen 05e1cb88d5 Update example tests 2023-08-24 13:26:10 -04:00
Nick Alteen bd79503369 Reconfigure tsconfig and eslint 2023-08-23 23:34:26 -04:00
Nick Alteen 464b2658f0 Create CI workflow and tests 2023-08-23 13:39:12 -04:00
Nick Alteen 0e82f80ee6 Set dist/index as entrypoint 2023-08-23 13:37:14 -04:00
Kengo TODA 6182022b1c
test: bump up jest to v27 that introduces new defaults (#315)
The jest-circus is now default runner, no need to depend on it explicitly.
The testEnvironment also changed its default to "node".
Also types/jest is now needless, we can use jest/globals instead.
https://jestjs.io/blog/2021/05/25/jest-27
2021-07-19 09:36:00 -04:00
Hung-I Wang 2525b376e4
Avoid spawning a shell when running node in test (#155)
`execSync` by default spawns a shell to exec the specified command. And,
without specifying an absolute path to the node binary, it will be
searched in `PATH` where yarn prepends a temporary directory containing
a shell script called **node** that wraps the original node binary with
exec, resulting in implicitly chaining a shell again.
On some Linux distros, the default non-interactive shell, such as the
Dash shell of Debian, silently discards dashes (`-`) in names of
environment variables. But GitHub Actions allows dashes in names of
input variables which are then converted to environment variables in the
form of `INPUT_<VARIABLE_NAME>`.
So the commit fix the error-prone test code by using execFileSync, which
by default exec directly without spawning a shell, to run node with its
absolute path.
2020-11-20 06:28:46 -05:00
Ross Brodbeck 9cdc5b327a
Update typescript template to follow some conventions (#42)
* Update default project to follow conventions
2019-12-06 14:22:35 -05:00
Yamboy1 a12634ced3
Small typo 2019-11-14 06:52:03 +13:00
Josh Gross 01408a6ef7 Fix example tests (#32) 2019-10-09 23:17:08 -04:00
Bryan MacFarlane b2a87e0a71 update with tests 2019-09-21 08:56:30 -04:00
Shawn Napora 9851c37052 Add workflow to build, test, and check formatting/artifacts on PR (#8)
* add workflow

* add workflow and remove husky

* prettier tests
2019-08-08 14:36:59 -04:00
Danny McCormick fce79f8f7c New toolkit 2019-07-22 14:15:40 -04:00
Danny McCormick eeda688ea3 Add template 2019-06-24 16:19:34 -04:00