Comparing version 0.0.18 to 0.0.19
@@ -121,2 +121,4 @@ 'use strict' | ||
is: value => ({ remember }) => remember(item, value), | ||
equals: otherItem => ({ recall, remember }) => | ||
remember(item, recall(otherItem)), | ||
}), | ||
@@ -123,0 +125,0 @@ } |
@@ -313,3 +313,3 @@ 'use strict' | ||
describe('Memory', () => { | ||
it('allows an actor to remember state', async () => { | ||
it('allows an actor to remember things', async () => { | ||
const joe = Actor({ ...Memory() }) | ||
@@ -320,2 +320,11 @@ await joe.attemptsTo(Remember.that('thing').is('something')) | ||
it('allows an actor to remember things under several names', async () => { | ||
const joe = Actor({ ...Memory() }) | ||
await joe.attemptsTo( | ||
Remember.that('thing').is('something'), | ||
Remember.that('other thing').equals('thing') | ||
) | ||
assert.equal(await joe.asks(Recall.about('other thing')), 'something') | ||
}) | ||
it("throws when asked for something it can't remember", async () => { | ||
@@ -322,0 +331,0 @@ const joe = Actor({ ...Memory() }) |
@@ -36,2 +36,6 @@ 'use strict' | ||
context.actors = {} | ||
context.abilities = {} | ||
for (const key of Object.keys(abilities)) { | ||
delete abilities[key] | ||
} | ||
} | ||
@@ -38,0 +42,0 @@ |
@@ -79,2 +79,11 @@ 'use strict' | ||
}) | ||
it('resets the abilities between tests', () => { | ||
const xrayVision = 'xray-vision' | ||
const elasticLimbs = 'elastic-limbs' | ||
abilities({ xrayVision }) | ||
reset() | ||
abilities({ elasticLimbs }) | ||
assert.deepEqual(Object.keys(abilities), ['elasticLimbs']) | ||
}) | ||
}) | ||
@@ -81,0 +90,0 @@ |
{ | ||
"name": "feynman", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "A screenplay pattern library for javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/feynman.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
604
28679
12