@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.
- package/.github/workflows/test_tests.yml +77 -0
- package/CHANGELOG.md +381 -0
- package/README.md +18 -0
- package/action.yml +158 -0
- package/lib/DOM.md.html +63 -0
- package/lib/github_integration/install-branch.js +84 -0
- package/lib/github_integration/puppeteer-utils.js +224 -0
- package/lib/github_integration/setup.js +4 -0
- package/lib/github_integration/takedown.js +4 -0
- package/lib/index.js +2 -0
- package/lib/scope.js +1632 -0
- package/lib/steps.js +878 -0
- package/lib/utils/env_vars.js +173 -0
- package/lib/utils/langs.js +51 -0
- package/lib/world.js +10 -0
- package/package.json +53 -0
- package/tests/features/assembly_line.feature +43 -0
- package/tests/features/establishing_steps.feature +22 -0
- package/tests/features/example_test.feature +11 -0
- package/tests/features/interactive_steps.feature +85 -0
- package/tests/features/observation_steps.feature +97 -0
- package/tests/features/reports.feature +482 -0
- package/tests/features/some_png_1.png +0 -0
- package/tests/features/some_png_2.png +0 -0
- package/tests/features/story_table_formats.feature +77 -0
- package/tests/features/story_tables.feature +88 -0
- package/tests/unit_tests/ensureSpecialRows.test.js +34 -0
- package/tests/unit_tests/env_vars.test.js +53 -0
- package/tests/unit_tests/fields.fixtures.js +904 -0
- package/tests/unit_tests/getAllFields.test.js +142 -0
- package/tests/unit_tests/getMatchingRows.test.js +261 -0
- package/tests/unit_tests/getSafeScenarioBaseFilename.fixtures.js +12 -0
- package/tests/unit_tests/getSafeScenarioBaseFilename.test.js +62 -0
- package/tests/unit_tests/getSafeScenarioFilename.test.js +83 -0
- package/tests/unit_tests/html.fixtures.js +861 -0
- package/tests/unit_tests/matches.fixtures.js +168 -0
- package/tests/unit_tests/names.fixtures.js +35 -0
- package/tests/unit_tests/normalizeTable.test.js +22 -0
- package/tests/unit_tests/special_rows.fixtures.js +101 -0
- 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
|
+
});
|