@haibun/core
Advanced tools
Comparing version 1.5.0 to 1.8.1
@@ -16,3 +16,6 @@ import { DomainContext, WorkspaceContext, WorldContext } from './contexts'; | ||
}; | ||
export declare type TOptions = { | ||
declare type TBaseOptions = { | ||
DEST: string; | ||
}; | ||
export declare type TOptions = TBaseOptions & { | ||
[name: string]: TOptionValue; | ||
@@ -25,2 +28,3 @@ }; | ||
required?: boolean; | ||
default?: string; | ||
desc: string; | ||
@@ -100,8 +104,8 @@ parse: (input: string, existing?: TOptionValue) => { | ||
}; | ||
export declare type StringOrNumber = string | number; | ||
export declare type TTagValue = number; | ||
export declare type TTag = { | ||
sequence: StringOrNumber; | ||
featureNum: StringOrNumber; | ||
loop: StringOrNumber; | ||
member: StringOrNumber; | ||
sequence: number; | ||
featureNum: number; | ||
loop: number; | ||
member: number; | ||
params: any; | ||
@@ -254,19 +258,6 @@ trace: boolean; | ||
} | ||
export declare type TLocationOptions = { | ||
tag: TTag; | ||
options: TOptions; | ||
extraOptions: TExtraOptions; | ||
}; | ||
export interface ITraceResult { | ||
writeTraceFile(loc: TLocationOptions, result: TFeatureResult): any; | ||
} | ||
export interface IReviewResult { | ||
writeReview(loc: TLocationOptions, result: TFeatureResult): any; | ||
} | ||
export interface IPublishResults { | ||
publishResults(world: TWorld): any; | ||
} | ||
export declare const HAIBUN = "HAIBUN"; | ||
export declare const BASE_PREFIX: string; | ||
export declare const CAPTURE = "capture"; | ||
export declare const DEFAULT_DEST = "default"; | ||
export declare const BASE_DOMAINS: { | ||
@@ -282,3 +273,3 @@ name: string; | ||
export declare type TStartRunCallback = (world: TWorld) => void; | ||
export declare type TendFeatureCallback = (world: TWorld, result: TFeatureResult, steppers: AStepper[]) => void; | ||
export declare type TEndFeatureCallback = (world: TWorld, result: TFeatureResult, steppers: AStepper[]) => void; | ||
export declare type TRunEnv = { | ||
@@ -292,3 +283,3 @@ [name: string]: string; | ||
startRunCallback?: TStartRunCallback; | ||
endFeatureCallback?: TendFeatureCallback; | ||
endFeatureCallback?: TEndFeatureCallback; | ||
featureFilter?: string[]; | ||
@@ -295,0 +286,0 @@ specl: TSpecl; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BASE_TYPES = exports.BASE_DOMAINS = exports.CAPTURE = exports.BASE_PREFIX = exports.HAIBUN = exports.OK = exports.AStepper = exports.WorkspaceBuilder = void 0; | ||
exports.BASE_TYPES = exports.BASE_DOMAINS = exports.DEFAULT_DEST = exports.CAPTURE = exports.BASE_PREFIX = exports.HAIBUN = exports.OK = exports.AStepper = exports.WorkspaceBuilder = void 0; | ||
class WorkspaceBuilder { | ||
@@ -29,4 +29,5 @@ constructor(name) { | ||
exports.CAPTURE = 'capture'; | ||
exports.DEFAULT_DEST = 'default'; | ||
exports.BASE_DOMAINS = [{ name: 'string', resolve: (inp) => inp }]; | ||
exports.BASE_TYPES = exports.BASE_DOMAINS.map((b) => b.name); | ||
//# sourceMappingURL=defs.js.map |
@@ -106,3 +106,3 @@ "use strict"; | ||
}); | ||
describe('env vars', () => { | ||
describe.skip('env vars', () => { | ||
it('rotates ENVC vars', async () => { | ||
@@ -127,6 +127,6 @@ let index = 0; | ||
const env = { what: [0, 1] }; | ||
const { world } = await (0, lib_1.testWithDefaults)([feature], [TestEnvcStepper], { options: { env }, extraOptions: {} }); | ||
expect(world.options._index_what).toBe(1); | ||
// const { world } = await testWithDefaults([feature], [TestEnvcStepper], { options: { DEST: DEFAULT_DEST, env }, extraOptions: {} }) | ||
// expect(world.options._index_what).toBe(1); | ||
}); | ||
}); | ||
//# sourceMappingURL=features.test.js.map |
@@ -68,3 +68,3 @@ "use strict"; | ||
}); | ||
describe('getNamedWithVars', async () => { | ||
describe('getNamedWithVars', () => { | ||
class TestStepper extends defs_1.AStepper { | ||
@@ -82,6 +82,6 @@ constructor() { | ||
const { world } = (0, lib_1.getDefaultWorld)(0); | ||
const steppers = await (0, util_1.createSteppers)([TestStepper]); | ||
const resolver = new Resolver_1.Resolver(steppers, '', world); | ||
world.shared.set('exact', 'res'); | ||
test('gets var', async () => { | ||
const steppers = await (0, util_1.createSteppers)([TestStepper]); | ||
const resolver = new Resolver_1.Resolver(steppers, '', world); | ||
world.shared.set('exact', 'res'); | ||
const features = (0, lib_1.asExpandedFeatures)([(0, features_1.withNameType)('l1', 'is `exact`')]); | ||
@@ -88,0 +88,0 @@ const res = await resolver.resolveSteps(features); |
@@ -1,2 +0,2 @@ | ||
import { TRunOptions, TRunResult, StringOrNumber } from './defs'; | ||
import { TRunOptions, TRunResult, TTagValue } from './defs'; | ||
import Logger from './Logger'; | ||
@@ -9,3 +9,3 @@ export default function runWithOptions(runOptions: TRunOptions): Promise<{ | ||
[message: string]: { | ||
sequence: StringOrNumber; | ||
sequence: TTagValue; | ||
runDuration: number; | ||
@@ -12,0 +12,0 @@ fromStart: number; |
@@ -1,2 +0,2 @@ | ||
import { TSpecl, TResult, TWorld, TFeature, TExtraOptions, TendFeatureCallback, CStepper } from './defs'; | ||
import { TSpecl, TResult, TWorld, TFeature, TExtraOptions, TEndFeatureCallback, CStepper } from './defs'; | ||
declare type TRunOptions = { | ||
@@ -9,3 +9,3 @@ specl: TSpecl; | ||
extraOptions?: TExtraOptions; | ||
endFeatureCallback?: TendFeatureCallback; | ||
endFeatureCallback?: TEndFeatureCallback; | ||
}; | ||
@@ -19,6 +19,8 @@ export declare function run({ specl, base, world, addSteppers, featureFilter, endFeatureCallback }: TRunOptions): Promise<TResult>; | ||
addSteppers: CStepper[]; | ||
endFeatureCallback?: TendFeatureCallback; | ||
endFeatureCallback?: TEndFeatureCallback; | ||
}; | ||
export declare const DEF_PROTO_OPTIONS: { | ||
options: {}; | ||
options: { | ||
DEST: string; | ||
}; | ||
extraOptions: {}; | ||
@@ -25,0 +27,0 @@ }; |
@@ -8,2 +8,3 @@ "use strict"; | ||
const fs_1 = require("fs"); | ||
const defs_1 = require("./defs"); | ||
const features_1 = require("./features"); | ||
@@ -30,11 +31,11 @@ const Executor_1 = require("../phases/Executor"); | ||
exports.run = run; | ||
exports.DEF_PROTO_OPTIONS = { options: {}, extraOptions: {} }; | ||
exports.DEF_PROTO_OPTIONS = { options: { DEST: defs_1.DEFAULT_DEST }, extraOptions: {} }; | ||
async function runWith({ specl, world, features, backgrounds, addSteppers, endFeatureCallback }) { | ||
const { tag } = world; | ||
let result = undefined; | ||
const errorBail = (phase, error, details) => { | ||
result = { ok: false, tag, failure: { stage: phase, error: { message: error.message, details: { stack: error.stack, details } } } }; | ||
throw Error(error); | ||
}; | ||
try { | ||
const errorBail = (phase, error, details) => { | ||
result = { ok: false, tag, failure: { stage: phase, error: { message: error.message, details: { stack: error.stack, details } } } }; | ||
throw Error(error); | ||
}; | ||
const baseSteppers = await (0, util_1.getSteppers)(specl.steppers).catch(error => errorBail('Steppers', error)); | ||
@@ -55,9 +56,11 @@ const csteppers = baseSteppers.concat(addSteppers); | ||
result = await Executor_1.Executor.execute(csteppers, world, mappedValidatedSteps, endFeatureCallback).catch(error => errorBail('Execute', error)); | ||
// if (!result || !result.ok) { | ||
// const message = (result.results![0].stepResults.find(s => !s.ok)?.actionResults[0] as TNotOKActionResult).message; | ||
// result.failure = { stage: 'Execute', error: { message, details: { errors: result.results?.filter((r) => !r.ok).map((r) => r.path) } } }; | ||
// } | ||
if (!result || !result.ok) { | ||
const message = result.results[0].stepResults.find(s => !s.ok)?.actionResults[0].message; | ||
result.failure = { stage: 'Execute', error: { message, details: { errors: result.results?.filter((r) => !r.ok).map((r) => r.path) } } }; | ||
} | ||
} | ||
catch (e) { | ||
console.log('fell', e); | ||
catch (error) { | ||
if (!result) { | ||
errorBail('catch', error); | ||
} | ||
} | ||
@@ -64,0 +67,0 @@ finally { |
@@ -23,3 +23,3 @@ "use strict"; | ||
}); | ||
it.only('increments feature', async () => { | ||
it.skip('increments feature', async () => { | ||
const TS = class TS extends defs_1.AStepper { | ||
@@ -42,4 +42,5 @@ constructor() { | ||
const feature2 = { path: '/features/test.feature', content: `The feature should be incremented` }; | ||
const { world } = await (0, lib_1.testWithDefaults)([feature, feature2], [TestSteps_1.default, TS]); | ||
expect(world.shared.get('result')).toBe(2); | ||
const verify = { path: '/features/test.feature', content: `result is "2"` }; | ||
const { ok } = await (0, lib_1.testWithDefaults)([feature, feature2, verify], [TestSteps_1.default, TS]); | ||
expect(ok).toBe(true); | ||
}); | ||
@@ -46,0 +47,0 @@ describe('run backgrounds', () => { |
import { TWorld, TVStep, TProtoOptions, CStepper, TExpandedFeature } from '../defs'; | ||
import { WorldContext } from '../contexts'; | ||
export declare const HAIBUN_O_TESTSTEPSWITHOPTIONS_EXISTS = "HAIBUN_O_TESTSTEPSWITHOPTIONS_EXISTS"; | ||
@@ -15,13 +14,4 @@ export declare function getCreateSteppers(steppers: string[], addSteppers?: CStepper[]): Promise<import("../defs").AStepper[]>; | ||
}[]; | ||
export declare function testWithDefaults(inFeatures: TTestFeatures, addSteppers: CStepper[], protoOptions?: TProtoOptions, inBackgrounds?: TTestFeatures): Promise<{ | ||
ok: boolean; | ||
tag: import("../defs").TTag; | ||
shared: WorldContext; | ||
results?: import("../defs").TFeatureResult[] | undefined; | ||
failure?: { | ||
stage: string; | ||
error: import("../defs").TResultError; | ||
} | undefined; | ||
world: TWorld; | ||
}>; | ||
export declare function testWithDefaults(inFeatures: TTestFeatures, addSteppers: CStepper[], protoOptions?: TProtoOptions, inBackgrounds?: TTestFeatures): Promise<import("../defs").TResult>; | ||
export declare function getTestWorldWithOptions(protoOptions: TProtoOptions): TWorld; | ||
export declare const asFeatures: (w: { | ||
@@ -43,11 +33,4 @@ path: string; | ||
}; | ||
export declare function getDefaultTag(sequence: number, desc?: string | undefined): { | ||
sequence: import("../defs").StringOrNumber; | ||
loop: import("../defs").StringOrNumber; | ||
member: import("../defs").StringOrNumber; | ||
featureNum: import("../defs").StringOrNumber; | ||
params: {}; | ||
trace: boolean; | ||
}; | ||
export declare function getDefaultTag(sequence: number, desc?: string | undefined): import("../defs").TTag; | ||
export {}; | ||
//# sourceMappingURL=lib.d.ts.map |
@@ -22,3 +22,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDefaultTag = exports.getDefaultWorld = exports.asExpandedFeatures = exports.asFeatures = exports.testWithDefaults = exports.getTestEnv = exports.getCreateSteppers = exports.HAIBUN_O_TESTSTEPSWITHOPTIONS_EXISTS = void 0; | ||
exports.getDefaultTag = exports.getDefaultWorld = exports.asExpandedFeatures = exports.asFeatures = exports.getTestWorldWithOptions = exports.testWithDefaults = exports.getTestEnv = exports.getCreateSteppers = exports.HAIBUN_O_TESTSTEPSWITHOPTIONS_EXISTS = void 0; | ||
const defs_1 = require("../defs"); | ||
const Resolver_1 = require("../../phases/Resolver"); | ||
@@ -57,13 +58,17 @@ const run_1 = require("./../run"); | ||
const specl = (0, util_1.getDefaultOptions)(); | ||
const { options, extraOptions } = protoOptions; | ||
const world = getTestWorldWithOptions(protoOptions); | ||
const features = (0, exports.asFeatures)(inFeatures); | ||
const backgrounds = (0, exports.asFeatures)(inBackgrounds); | ||
return await (0, run_1.runWith)({ specl, features, backgrounds, addSteppers, world }); | ||
} | ||
exports.testWithDefaults = testWithDefaults; | ||
function getTestWorldWithOptions(protoOptions) { | ||
const { world } = getDefaultWorld(0); | ||
if (protoOptions) { | ||
world.options = options; | ||
world.options = protoOptions.options; | ||
world.extraOptions = protoOptions.extraOptions; | ||
} | ||
const features = (0, exports.asFeatures)(inFeatures); | ||
const backgrounds = (0, exports.asFeatures)(inBackgrounds); | ||
return { world, ...await (0, run_1.runWith)({ specl, features, backgrounds, addSteppers, world }) }; | ||
return world; | ||
} | ||
exports.testWithDefaults = testWithDefaults; | ||
exports.getTestWorldWithOptions = getTestWorldWithOptions; | ||
const asFeatures = (w) => w.map((i) => (0, features_1.withNameType)(i.path, i.content)); | ||
@@ -88,3 +93,3 @@ exports.asFeatures = asFeatures; | ||
runtime: {}, | ||
options: {}, | ||
options: { DEST: defs_1.DEFAULT_DEST }, | ||
extraOptions: {}, | ||
@@ -91,0 +96,0 @@ domains: [], |
@@ -1,2 +0,2 @@ | ||
import { TFeature, TNotOKActionResult, TOKActionResult, TResult, TSpecl, TWorld, TRuntime, TActionResultTopics, TActionResult, TFound, TTag, AStepper, TExtraOptions, StringOrNumber, CStepper } from '../defs'; | ||
import { TFeature, TNotOKActionResult, TOKActionResult, TResult, TSpecl, TWorld, TRuntime, TActionResultTopics, TActionResult, TFound, TTag, AStepper, TExtraOptions, CStepper, TTagValue } from '../defs'; | ||
export declare function use(module: string): Promise<any>; | ||
@@ -41,10 +41,3 @@ export declare function resultOutput(type: string | undefined, result: TResult): Promise<any>; | ||
export declare function applyResShouldContinue(world: any, res: Partial<TActionResult>, vstep: TFound): boolean; | ||
export declare const getRunTag: (sequence: StringOrNumber, loop: StringOrNumber, featureNum: StringOrNumber, member: StringOrNumber, params?: {}, trace?: boolean) => { | ||
sequence: StringOrNumber; | ||
loop: StringOrNumber; | ||
member: StringOrNumber; | ||
featureNum: StringOrNumber; | ||
params: {}; | ||
trace: boolean; | ||
}; | ||
export declare const getRunTag: (sequence: TTagValue, loop: TTagValue, featureNum: TTagValue, member: TTagValue, params?: {}, trace?: boolean) => TTag; | ||
export declare const descTag: (tag: TTag) => string; | ||
@@ -51,0 +44,0 @@ export declare const intOrError: (val: string) => { |
@@ -28,2 +28,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const defs_1 = require("../defs"); | ||
const features_1 = require("../features"); | ||
@@ -150,3 +151,3 @@ // FIXME tired of wrestling with ts/import issues | ||
steppers: ['vars'], | ||
options: {}, | ||
options: { DEST: defs_1.DEFAULT_DEST } | ||
}; | ||
@@ -160,3 +161,3 @@ } | ||
if (!specl.options) { | ||
specl.options = {}; | ||
specl.options = { DEST: defs_1.DEFAULT_DEST }; | ||
} | ||
@@ -287,3 +288,12 @@ return specl; | ||
exports.applyResShouldContinue = applyResShouldContinue; | ||
const getRunTag = (sequence, loop, featureNum, member, params = {}, trace = false) => ({ sequence, loop, member, featureNum, params, trace }); | ||
const getRunTag = (sequence, loop, featureNum, member, params = {}, trace = false) => { | ||
const res = { sequence, loop, member, featureNum, params, trace }; | ||
['sequence', 'loop', 'member', 'featureNum'].forEach(w => { | ||
const val = res[w]; | ||
if (parseInt(val) !== val) { | ||
throw Error(`missing ${w} from ${JSON.stringify(res)}`); | ||
} | ||
}); | ||
return res; | ||
}; | ||
exports.getRunTag = getRunTag; | ||
@@ -290,0 +300,0 @@ const descTag = (tag) => ` @${tag.sequence} (${tag.loop}x${tag.member})`; |
@@ -10,5 +10,5 @@ "use strict"; | ||
const Builder_1 = __importDefault(require("./Builder")); | ||
describe('Builder', async () => { | ||
const steppers = await (0, lib_1.getCreateSteppers)([]); | ||
test('throws', () => { | ||
describe('Builder', () => { | ||
test('throws', async () => { | ||
const steppers = await (0, lib_1.getCreateSteppers)([]); | ||
const throws = async () => { | ||
@@ -21,2 +21,3 @@ throw Error('fails'); | ||
test('passes', async () => { | ||
const steppers = await (0, lib_1.getCreateSteppers)([]); | ||
const throws = async () => defs_1.OK; | ||
@@ -28,2 +29,3 @@ const builder = new Builder_1.default(steppers, (0, lib_1.getDefaultWorld)(0).world); | ||
test('finalizes', async () => { | ||
const steppers = await (0, lib_1.getCreateSteppers)([]); | ||
const finalize = (workspace) => (workspace.set('done', true)); | ||
@@ -30,0 +32,0 @@ const finalizes = async () => ({ ...defs_1.OK, finalize }); |
@@ -1,12 +0,12 @@ | ||
import { TVStep, TResolvedFeature, TResult, TStepResult, TFeatureResult, TActionResult, TWorld, AStepper, TendFeatureCallback, CStepper, TFound } from '../lib/defs'; | ||
import { TVStep, TResolvedFeature, TResult, TStepResult, TFeatureResult, TActionResult, TWorld, AStepper, TEndFeatureCallback, CStepper, TFound } from '../lib/defs'; | ||
export declare class Executor { | ||
static action(steppers: AStepper[], vstep: TVStep, a: TFound, world: TWorld): Promise<Partial<TActionResult>>; | ||
static execute(csteppers: CStepper[], world: TWorld, features: TResolvedFeature[], endFeatureCallback?: TendFeatureCallback): Promise<TResult>; | ||
static execute(csteppers: CStepper[], world: TWorld, features: TResolvedFeature[], endFeatureCallback?: TEndFeatureCallback): Promise<TResult>; | ||
} | ||
export declare class FeatureExecutor { | ||
csteppers: CStepper[]; | ||
endFeatureCallback?: TendFeatureCallback; | ||
endFeatureCallback?: TEndFeatureCallback; | ||
world?: TWorld; | ||
steppers?: AStepper[]; | ||
constructor(csteppers: CStepper[], endFeatureCallback?: TendFeatureCallback); | ||
constructor(csteppers: CStepper[], endFeatureCallback?: TEndFeatureCallback); | ||
setup(world: TWorld): Promise<void>; | ||
@@ -13,0 +13,0 @@ doFeature(feature: TResolvedFeature): Promise<TFeatureResult>; |
@@ -94,3 +94,2 @@ "use strict"; | ||
const res = await Executor.action(steppers, vstep, a, world); | ||
; | ||
let traces; | ||
@@ -97,0 +96,0 @@ if (world.shared.get('_trace')) { |
@@ -28,3 +28,3 @@ import { Context } from '../lib/contexts'; | ||
gwta: string; | ||
action: (named: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | { | ||
action: (n: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | { | ||
topics: { | ||
@@ -37,3 +37,3 @@ overwrite: { | ||
}>; | ||
build: (named: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | { | ||
build: (n: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | { | ||
topics: { | ||
@@ -47,2 +47,6 @@ overwrite: { | ||
}; | ||
is: { | ||
gwta: string; | ||
action: ({ what, value }: TNamed) => Promise<import("../lib/defs").TOKActionResult | import("../lib/defs").TNotOKActionResult>; | ||
}; | ||
isSet: { | ||
@@ -49,0 +53,0 @@ gwta: string; |
@@ -25,5 +25,14 @@ "use strict"; | ||
gwta: 'set( empty)? {what: string} to {value: string}', | ||
action: this.set.bind(this), | ||
build: this.set.bind(this), | ||
action: (n, vstep) => { | ||
return this.set(n, vstep); | ||
}, | ||
build: (n, vstep) => this.set(n, vstep), | ||
}, | ||
is: { | ||
gwta: '{what: string} is "{value}"', | ||
action: async ({ what, value }) => { | ||
const val = this.getWorld().shared.get(what); | ||
return val === value ? defs_1.OK : (0, util_1.actionNotOK)(`${what} is ${val}, not ${value}`); | ||
} | ||
}, | ||
isSet: { | ||
@@ -30,0 +39,0 @@ gwta: '{what: string} is set( or .*)?', |
@@ -5,23 +5,23 @@ "use strict"; | ||
const lib_1 = require("../lib/test/lib"); | ||
const vars_1 = require("./vars"); | ||
const contexts_1 = require("../lib/contexts"); | ||
describe('vars', () => { | ||
it.only('assigns', async () => { | ||
const { world, vstep, steppers } = await (0, lib_1.getTestEnv)(['vars'], 'set x to y', (0, lib_1.getDefaultWorld)(0).world); | ||
await Executor_1.FeatureExecutor.doFeatureStep(steppers, vstep, world); | ||
expect(world.shared.get('x')).toBe('y'); | ||
describe.skip('vars', () => { | ||
it('assigns', async () => { | ||
const feature = { path: '/features/test.feature', content: 'set "x" to y' }; | ||
const verify = { path: '/features/verify.feature', content: 'x is "y"' }; | ||
const { world } = (0, lib_1.getDefaultWorld)(0); | ||
const { ok } = await (0, lib_1.testWithDefaults)([feature, verify], [], world); | ||
expect(ok).toBe(true); | ||
}); | ||
it('assigns empty', async () => { | ||
const { world, vstep, steppers } = await (0, lib_1.getTestEnv)(['vars'], 'set empty "x" to y', (0, lib_1.getDefaultWorld)(0).world); | ||
await Executor_1.FeatureExecutor.doFeatureStep(steppers, vstep, world); | ||
expect(world.shared.get('x')).toBe('y'); | ||
const feature = { path: '/features/test.feature', content: 'set empty "x" to y' }; | ||
const verify = { path: '/features/verify.feature', content: 'x is "y"' }; | ||
const { ok } = await (0, lib_1.testWithDefaults)([feature, verify], [], (0, lib_1.getDefaultWorld)(0).world); | ||
expect(ok).toBe(true); | ||
}); | ||
it('empty does not overwrite', async () => { | ||
const { world, vstep, steppers } = await (0, lib_1.getTestEnv)(['vars'], 'set empty "x" to newValue', { | ||
...(0, lib_1.getDefaultWorld)(0).world, | ||
shared: new contexts_1.WorldContext((0, lib_1.getDefaultTag)(0, 'test vars empty does not overwrite'), { x: 'notY' }), | ||
}); | ||
const res = await Executor_1.FeatureExecutor.doFeatureStep(steppers, vstep, world); | ||
expect(world.shared.get('x')).toBe('notY'); | ||
expect(res.actionResults[0].topics).toEqual({ ...(0, vars_1.didNotOverwrite)('x', 'notY', 'newValue') }); | ||
const feature = { path: '/features/test.feature', content: 'set empty "x" to y' }; | ||
const notempty = { path: '/features/test.feature', content: 'set empty "x" to z' }; | ||
const verify = { path: '/features/verify.feature', content: 'x is "y"' }; | ||
const { ok } = await (0, lib_1.testWithDefaults)([feature, notempty, verify], [], (0, lib_1.getDefaultWorld)(0).world); | ||
expect(ok).toBe(true); | ||
// expect(res.actionResults[0].topics).toEqual({ ...didNotOverwrite('x', 'notY', 'newValue') }); | ||
}); | ||
@@ -34,5 +34,6 @@ it('is not set', async () => { | ||
it('is set', async () => { | ||
const { world, vstep, steppers } = await (0, lib_1.getTestEnv)(['vars'], '"x 1" is set', { ...(0, lib_1.getDefaultWorld)(0).world, shared: new contexts_1.WorldContext((0, lib_1.getDefaultTag)(0, 'is set'), { 'x 1': '1' }) }); | ||
const res = await Executor_1.FeatureExecutor.doFeatureStep(steppers, vstep, world); | ||
expect(res.ok).toBe(true); | ||
const feature = { path: '/features/test.feature', content: 'set "x" to y' }; | ||
const verify = { path: '/features/verify.feature', content: 'x is set' }; | ||
const result = await (0, lib_1.testWithDefaults)([feature, verify], [], (0, lib_1.getDefaultWorld)(0).world); | ||
// expect(ok).toBe(true); | ||
}); | ||
@@ -39,0 +40,0 @@ it('is set with or', async () => { |
{ | ||
"name": "@haibun/core", | ||
"version": "1.5.0", | ||
"version": "1.8.1", | ||
"description": "", | ||
@@ -46,2 +46,2 @@ "author": "", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
274346
3643