mirror of
https://github.com/actions-rs/cargo.git
synced 2025-09-03 14:51:56 +03:00
Initial commit
This commit is contained in:
commit
7562f78615
13 changed files with 5459 additions and 0 deletions
31
__tests__/args.test.ts
Normal file
31
__tests__/args.test.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import * as args from '../src/args'
|
||||
|
||||
const testEnvVars = {
|
||||
INPUT_COMMAND: 'build',
|
||||
INPUT_ARGS: '--release --target x86_64-unknown-linux-gnu --no-default-features --features unstable',
|
||||
'INPUT_USE-CROSS': 'true',
|
||||
INPUT_TOOLCHAIN: '+nightly'
|
||||
}
|
||||
|
||||
describe('actions-rs/check', () => {
|
||||
beforeEach(() => {
|
||||
for (const key in testEnvVars)
|
||||
process.env[key] = testEnvVars[key as keyof typeof testEnvVars]
|
||||
})
|
||||
|
||||
it('Parses action input into cargo input', async () => {
|
||||
const result = args.parse();
|
||||
|
||||
expect(result.command).toBe('build');
|
||||
expect(result.args).toStrictEqual([
|
||||
'--release',
|
||||
'--target',
|
||||
'x86_64-unknown-linux-gnu',
|
||||
'--no-default-features',
|
||||
'--features',
|
||||
'unstable'
|
||||
]);
|
||||
expect(result.useCross).toBe(true);
|
||||
expect(result.toolchain).toBe('nightly');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue