@w3ltraumpirat
@SamirTalwar So, right now it's ugly as hell
(all in one file), but it works actually quite nice: Gherkin file:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/features/CheckingAccount.feature
Implementation of the runner is in:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js
3 replies
@w3ltraumpirat
@SamirTalwar Gherkin is parsed, added as STEP
actions to the store (for record) the steps are executed:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L147
all modifications are published in store (for Given ...) "Then" tests use state:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L194
created by reducers:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L41
@w3ltraumpirat
@SamirTalwar I haven't figured out how to
drive jest from the features (a description per feature + scenario, a test() per
step), because it does not play well nesting in promise loops:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L487
@w3ltraumpirat
@SamirTalwar The app under test is a
@goserverless project, the handlers for the
routers are set up here:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L115
That way I can directly call them locally.
If something goes wrong I can print a nice view, of what happened:
https://github.com/ausgaben/serverless-backend/blob/2cb65aac0cf39a8fc076a26c618ec3b55fd1fb35/__test__/features/features.spec.js#L366