@suffolklitlab/alkiln 3.0.9

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.
Files changed (40) hide show
  1. package/.github/workflows/test_tests.yml +77 -0
  2. package/CHANGELOG.md +381 -0
  3. package/README.md +18 -0
  4. package/action.yml +158 -0
  5. package/lib/DOM.md.html +63 -0
  6. package/lib/github_integration/install-branch.js +84 -0
  7. package/lib/github_integration/puppeteer-utils.js +224 -0
  8. package/lib/github_integration/setup.js +4 -0
  9. package/lib/github_integration/takedown.js +4 -0
  10. package/lib/index.js +2 -0
  11. package/lib/scope.js +1632 -0
  12. package/lib/steps.js +878 -0
  13. package/lib/utils/env_vars.js +173 -0
  14. package/lib/utils/langs.js +51 -0
  15. package/lib/world.js +10 -0
  16. package/package.json +53 -0
  17. package/tests/features/assembly_line.feature +43 -0
  18. package/tests/features/establishing_steps.feature +22 -0
  19. package/tests/features/example_test.feature +11 -0
  20. package/tests/features/interactive_steps.feature +85 -0
  21. package/tests/features/observation_steps.feature +97 -0
  22. package/tests/features/reports.feature +482 -0
  23. package/tests/features/some_png_1.png +0 -0
  24. package/tests/features/some_png_2.png +0 -0
  25. package/tests/features/story_table_formats.feature +77 -0
  26. package/tests/features/story_tables.feature +88 -0
  27. package/tests/unit_tests/ensureSpecialRows.test.js +34 -0
  28. package/tests/unit_tests/env_vars.test.js +53 -0
  29. package/tests/unit_tests/fields.fixtures.js +904 -0
  30. package/tests/unit_tests/getAllFields.test.js +142 -0
  31. package/tests/unit_tests/getMatchingRows.test.js +261 -0
  32. package/tests/unit_tests/getSafeScenarioBaseFilename.fixtures.js +12 -0
  33. package/tests/unit_tests/getSafeScenarioBaseFilename.test.js +62 -0
  34. package/tests/unit_tests/getSafeScenarioFilename.test.js +83 -0
  35. package/tests/unit_tests/html.fixtures.js +861 -0
  36. package/tests/unit_tests/matches.fixtures.js +168 -0
  37. package/tests/unit_tests/names.fixtures.js +35 -0
  38. package/tests/unit_tests/normalizeTable.test.js +22 -0
  39. package/tests/unit_tests/special_rows.fixtures.js +101 -0
  40. package/tests/unit_tests/tables.fixtures.js +428 -0
@@ -0,0 +1,53 @@
1
+ const chai = require('chai');
2
+ const expect = chai.expect;
3
+
4
+ const env_vars = require("../../lib/utils/env_vars.js");
5
+ const validateEnvironment = env_vars.validateEnvironment;
6
+
7
+ describe('env_vars', function () {
8
+ describe('validateEnvironment', function() {
9
+
10
+ /**
11
+ * All required variables should be defined in .env. For reference, those variables are the following:
12
+ *
13
+ * PLAYGROUND_ID
14
+ * PLAYGROUND_EMAIL
15
+ * PLAYGROUND_PASSWORD
16
+ * BASE_URL
17
+ * REPO_URL
18
+ */
19
+ it("All variables set", function() {
20
+ env_vars.validateEnvironment();
21
+ });
22
+
23
+ /**
24
+ * This test has an ordering dependency with the test below. I'm not certain if I am getting lucky or if I need to explicitly declare the order.
25
+ */
26
+ it("One variable missing", function() {
27
+ delete process.env.PLAYGROUND_PASSWORD;
28
+
29
+ expect(env_vars.validateEnvironment).to.throw(ReferenceError, /PLAYGROUND_PASSWORD/);
30
+ });
31
+
32
+ /**
33
+ * Delete all environment variables before validating the variables.
34
+ */
35
+ it("No variables set", function() {
36
+ delete process.env.PLAYGROUND_ID;
37
+ delete process.env.PLAYGROUND_EMAIL;
38
+ delete process.env.PLAYGROUND_PASSWORD;
39
+ delete process.env.BASE_URL;
40
+ delete process.env.REPO_URL;
41
+
42
+ // This test just tests that the variable names show up in a fixed order.
43
+ //
44
+ // For whatever reason, /PLAYGROUND_ID.*PLAYGROUND_EMAIL.*PLAYGROUND_PASSWORD.*SERVER_URL.*REPO_URL/ simply wouldn't work once I got to the first letter
45
+ // after the second underscore so I have used separate matchers.
46
+ expect(env_vars.validateEnvironment).to.throw(ReferenceError, /PLAYGROUND_ID/);
47
+ expect(env_vars.validateEnvironment).to.throw(ReferenceError, /PLAYGROUND_EMAIL/);
48
+ expect(env_vars.validateEnvironment).to.throw(ReferenceError, /PLAYGROUND_PASSWORD/);
49
+ expect(env_vars.validateEnvironment).to.throw(/SERVER_URL/);
50
+ expect(env_vars.validateEnvironment).to.throw(/REPO_URL/);
51
+ });
52
+ });
53
+ });