vitest-cucumber-plugin 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +42 -0
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/RELEASE_NOTES.md +9 -0
- package/package.json +34 -0
- package/rollup-nearley.js +10 -0
- package/run-tests +8 -0
- package/src/generate/example.js +20 -0
- package/src/generate/examples.js +47 -0
- package/src/generate/feature.js +45 -0
- package/src/generate/index.js +13 -0
- package/src/generate/scenarioOutline.js +18 -0
- package/src/generate/tests.js +23 -0
- package/src/generate/util.js +10 -0
- package/src/gherkin.js +171 -0
- package/src/gherkin.ne +130 -0
- package/src/gherkin.umd.js +118 -0
- package/src/index.js +65 -0
- package/src/logger.js +7 -0
- package/src/parameterize.js +7 -0
- package/src/parse.js +21 -0
- package/src/steps.js +42 -0
- package/tests/background/features/background.feature +25 -0
- package/tests/background/features/step_definitions/steps.js +30 -0
- package/tests/background/package-lock.json +1967 -0
- package/tests/background/package.json +11 -0
- package/tests/background/vite.config.js +9 -0
- package/tests/comments/features/is-it-friday.feature +10 -0
- package/tests/comments/features/step_definitions/stepdefs.js +15 -0
- package/tests/comments/package-lock.json +1967 -0
- package/tests/comments/package.json +11 -0
- package/tests/comments/vite.config.js +9 -0
- package/tests/data-tables/features/data-tables.feature +25 -0
- package/tests/data-tables/features/step_definitions/data-tables.js +21 -0
- package/tests/data-tables/package-lock.json +1967 -0
- package/tests/data-tables/package.json +11 -0
- package/tests/data-tables/vite.config.js +9 -0
- package/tests/data-tables/vite.config.js.timestamp-1682359000824-3876ac2e9095b.mjs +13 -0
- package/tests/is-it-friday/features/is-it-friday.feature +7 -0
- package/tests/is-it-friday/features/step_definitions/stepdefs.js +15 -0
- package/tests/is-it-friday/package-lock.json +1967 -0
- package/tests/is-it-friday/package.json +11 -0
- package/tests/is-it-friday/vite.config.js +9 -0
- package/tests/is-it-friday-scenario-outline/features/is-it-friday.feature +13 -0
- package/tests/is-it-friday-scenario-outline/features/step_definitions/stepdefs.js +15 -0
- package/tests/is-it-friday-scenario-outline/package-lock.json +1967 -0
- package/tests/is-it-friday-scenario-outline/package.json +11 -0
- package/tests/is-it-friday-scenario-outline/vite.config.js +9 -0
- package/tests/is-it-friday-two-scenarios/features/is-it-friday.feature +12 -0
- package/tests/is-it-friday-two-scenarios/features/step_definitions/stepdefs.js +19 -0
- package/tests/is-it-friday-two-scenarios/package-lock.json +1967 -0
- package/tests/is-it-friday-two-scenarios/package.json +11 -0
- package/tests/is-it-friday-two-scenarios/vite.config.js +9 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/features/friday.feature +7 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/features/step_definitions/stepdefs.js +19 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/features/sunday.feature +8 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/package-lock.json +1967 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/package.json +11 -0
- package/tests/is-it-friday-two-scenarios-multiple-feature-files/vite.config.js +9 -0
- package/tests/keyword-aliases/features/scenario-outline.feature +20 -0
- package/tests/keyword-aliases/features/scenario.feature +14 -0
- package/tests/keyword-aliases/features/step_definitions/steps.js +30 -0
- package/tests/keyword-aliases/features/steps.feature +28 -0
- package/tests/keyword-aliases/package-lock.json +1967 -0
- package/tests/keyword-aliases/package.json +11 -0
- package/tests/keyword-aliases/vite.config.js +9 -0
- package/tests/tags/features/skip.feature +9 -0
- package/tests/tags/features/step_definitions/steps.js +30 -0
- package/tests/tags/features/tags-scenario-outline.feature +30 -0
- package/tests/tags/features/tags.feature +26 -0
- package/tests/tags/package-lock.json +1967 -0
- package/tests/tags/package.json +11 -0
- package/tests/tags/vite.config.js +12 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// vite.config.js
|
|
2
|
+
import { defineConfig } from "file:///home/sam/src/vitest-cucumber-plugin/tests/data-tables/node_modules/vitest/dist/config.js";
|
|
3
|
+
import vitestCucumberPlugin from "file:///home/sam/src/vitest-cucumber-plugin/src/index.js";
|
|
4
|
+
var vite_config_default = defineConfig({
|
|
5
|
+
plugins: [vitestCucumberPlugin()],
|
|
6
|
+
test: {
|
|
7
|
+
include: ["**/*.feature"]
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
vite_config_default as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9zYW0vc3JjL3ZpdGVzdC1jdWN1bWJlci1wbHVnaW4vdGVzdHMvZGF0YS10YWJsZXNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIi9ob21lL3NhbS9zcmMvdml0ZXN0LWN1Y3VtYmVyLXBsdWdpbi90ZXN0cy9kYXRhLXRhYmxlcy92aXRlLmNvbmZpZy5qc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vaG9tZS9zYW0vc3JjL3ZpdGVzdC1jdWN1bWJlci1wbHVnaW4vdGVzdHMvZGF0YS10YWJsZXMvdml0ZS5jb25maWcuanNcIjtpbXBvcnQgeyBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlc3QvY29uZmlnJ1xuaW1wb3J0IHZpdGVzdEN1Y3VtYmVyUGx1Z2luIGZyb20gJ3ZpdGVzdC1jdWN1bWJlci1wbHVnaW4nO1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICAgIHBsdWdpbnM6IFt2aXRlc3RDdWN1bWJlclBsdWdpbigpXSxcbiAgICB0ZXN0OiB7XG4gICAgICAgIGluY2x1ZGUgOiBbICcqKi8qLmZlYXR1cmUnIF1cbiAgICB9LFxufSlcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFBb1YsU0FBUyxvQkFBb0I7QUFDalgsT0FBTywwQkFBMEI7QUFFakMsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDeEIsU0FBUyxDQUFDLHFCQUFxQixDQUFDO0FBQUEsRUFDaEMsTUFBTTtBQUFBLElBQ0YsU0FBVSxDQUFFLGNBQWU7QUFBQSxFQUMvQjtBQUNKLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Given, When, Then } from 'vitest-cucumber-plugin';
|
|
2
|
+
import { expect } from 'vitest'
|
|
3
|
+
import _ from 'lodash/fp';
|
|
4
|
+
|
|
5
|
+
Given('today is Sunday', function () {
|
|
6
|
+
return { today : 'Sunday' };
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
When('I ask whether it\'s Friday yet', function (state) {
|
|
10
|
+
return _.set('answer','Nope',state);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Then('I should be told {string}', function (state,[ answer ]) {
|
|
14
|
+
expect(state.answer).toBe(answer);
|
|
15
|
+
});
|