mirror of
https://github.com/actions-rs/cargo.git
synced 2025-09-03 14:51:56 +03:00
Add formatting and linting tools
This commit is contained in:
parent
ecffd7835a
commit
efdda56b63
14 changed files with 2826 additions and 472 deletions
|
@ -1,32 +1,33 @@
|
|||
import * as input from '../src/input'
|
||||
import * as input from "../src/input";
|
||||
|
||||
const testEnvVars = {
|
||||
INPUT_COMMAND: 'build',
|
||||
INPUT_COMMAND: "build",
|
||||
// There are few unnecessary spaces here to check that args parser works properly
|
||||
INPUT_ARGS: ' --release --target x86_64-unknown-linux-gnu --no-default-features --features unstable ',
|
||||
'INPUT_USE-CROSS': 'true',
|
||||
INPUT_TOOLCHAIN: '+nightly'
|
||||
}
|
||||
INPUT_ARGS:
|
||||
" --release --target x86_64-unknown-linux-gnu --no-default-features --features unstable ",
|
||||
"INPUT_USE-CROSS": "true",
|
||||
INPUT_TOOLCHAIN: "+nightly",
|
||||
};
|
||||
|
||||
describe('actions-rs/cargo/input', () => {
|
||||
describe("actions-rs/cargo/input", () => {
|
||||
beforeEach(() => {
|
||||
for (const key in testEnvVars)
|
||||
process.env[key] = testEnvVars[key as keyof typeof testEnvVars]
|
||||
})
|
||||
for (const key in testEnvVars)
|
||||
process.env[key] = testEnvVars[key as keyof typeof testEnvVars];
|
||||
});
|
||||
|
||||
it('Parses action input into cargo input', async () => {
|
||||
it("Parses action input into cargo input", () => {
|
||||
const result = input.get();
|
||||
|
||||
expect(result.command).toBe('build');
|
||||
expect(result.command).toBe("build");
|
||||
expect(result.args).toStrictEqual([
|
||||
'--release',
|
||||
'--target',
|
||||
'x86_64-unknown-linux-gnu',
|
||||
'--no-default-features',
|
||||
'--features',
|
||||
'unstable'
|
||||
"--release",
|
||||
"--target",
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"--no-default-features",
|
||||
"--features",
|
||||
"unstable",
|
||||
]);
|
||||
expect(result.useCross).toBe(true);
|
||||
expect(result.toolchain).toBe('nightly');
|
||||
expect(result.toolchain).toBe("nightly");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue