add initial macOS support #40

This commit is contained in:
undergroundwires
2021-01-13 16:31:20 +01:00
parent 2428de23ee
commit 8a8b7319d5
99 changed files with 2663 additions and 1135 deletions

View File

@@ -3,16 +3,15 @@ import 'mocha';
import { expect } from 'chai';
import { Script } from '@/domain/Script';
import { RecommendationLevel } from '@/domain/RecommendationLevel';
import { ScriptCode } from '@/domain/ScriptCode';
import { IScriptCode } from '@/domain/IScriptCode';
import { ScriptCodeStub } from '../stubs/ScriptCodeStub';
describe('Script', () => {
describe('ctor', () => {
describe('scriptCode', () => {
it('sets as expected', () => {
// arrange
const name = 'test-script';
const expected = new ScriptCode(name, 'expected-execute', 'expected-revert');
const expected = new ScriptCodeStub();
const sut = new ScriptBuilder()
.withCode(expected)
.build();
@@ -110,12 +109,14 @@ describe('Script', () => {
class ScriptBuilder {
private name = 'test-script';
private code: IScriptCode = new ScriptCode(this.name, 'code', 'revert-code');
private code: IScriptCode = new ScriptCodeStub();
private level = RecommendationLevel.Standard;
private documentationUrls: readonly string[] = undefined;
public withCodes(code: string, revertCode = ''): ScriptBuilder {
this.code = new ScriptCode(this.name, code, revertCode);
this.code = new ScriptCodeStub()
.withExecute(code)
.withRevert(revertCode);
return this;
}