mirror of
https://github.com/game-ci/unity-activate
synced 2026-01-31 15:39:05 +08:00
* Upgrade to using typescript instead of javascript and use game-ci images instead of gableroux images * Fix errors * Update bash script * Fix test * Remove test * Add versioning * Update husky * Update husky * Update husky * Update package.json * Update husky and image-tag * Use 'yarn lint-staged' instead of 'npx lint-staged' * Update entrypoint.sh
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import Action from './action';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
describe('Action', () => {
|
|
describe('compatibility check', () => {
|
|
it('throws for anything other than linux', () => {
|
|
if (process.platform !== 'linux') {
|
|
expect(() => Action.checkCompatibility()).toThrow();
|
|
} else {
|
|
expect(() => Action.checkCompatibility()).not.toThrow();
|
|
}
|
|
});
|
|
});
|
|
|
|
it('returns the root folder of the action', () => {
|
|
const { rootFolder, canonicalName } = Action;
|
|
|
|
expect(path.basename(rootFolder)).toStrictEqual(canonicalName);
|
|
expect(fs.existsSync(rootFolder)).toStrictEqual(true);
|
|
});
|
|
|
|
it('returns the action folder', () => {
|
|
const { actionFolder } = Action;
|
|
|
|
expect(path.basename(actionFolder)).toStrictEqual('dist');
|
|
expect(fs.existsSync(actionFolder)).toStrictEqual(true);
|
|
});
|
|
|
|
it('returns the docker file', () => {
|
|
const { dockerfile } = Action;
|
|
|
|
expect(path.basename(dockerfile)).toStrictEqual('Dockerfile');
|
|
expect(fs.existsSync(dockerfile)).toStrictEqual(true);
|
|
});
|
|
});
|