testaro 5.1.3 → 5.2.2

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/.eslintrc.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "commonjs": true,
5
+ "es2021": true,
6
+ "node": true
7
+ },
8
+ "extends": "eslint:recommended",
9
+ "parserOptions": {
10
+ "ecmaVersion": 2021
11
+ },
12
+ "rules": {
13
+ "indent": [
14
+ "error",
15
+ 2,
16
+ {
17
+ "MemberExpression": 0,
18
+ "ObjectExpression": "first"
19
+ }
20
+ ],
21
+ "linebreak-style": [
22
+ "error",
23
+ "unix"
24
+ ],
25
+ "quotes": [
26
+ "error",
27
+ "single"
28
+ ],
29
+ "semi": [
30
+ "error",
31
+ "always"
32
+ ],
33
+ "no-use-before-define": [
34
+ "error"
35
+ ],
36
+ "brace-style": [
37
+ "error",
38
+ "stroustrup"
39
+ ]
40
+ }
41
+ }
package/README.md CHANGED
@@ -292,6 +292,38 @@ In case you want to perform more than one `tenon` test with the same script, you
292
292
 
293
293
  Tenon recommends giving it a public URL rather than giving it the content of a page, if possible. So, it is best to give the `withNewContent` property of the `tenonRequest` command the value `true`, unless the page is not public.
294
294
 
295
+ ###### HTML CodeSniffer
296
+
297
+ The `htmlcs` test makes use of the`htmlcs/HTMLCS.js` file. That file was created, and can be recreated if necessary, as follows:
298
+
299
+ 1. Clone the (HTML CodeSniffer package)[https://github.com/squizlabs/HTML_CodeSniffer].
300
+ 1. Make that package’s directory the active directory.
301
+ 1. Install the HTML CodeSniffer dependencies by executing `npm install`.
302
+ 1. Build the HTML CodeSniffer auditor by executing `grunt build`.
303
+ 1. Copy the `build/HTMLCS.js` and `build/licence.txt` files into the `htmlcs` directory of Testaro.
304
+ 1. Edit the Testaro copy of `htmlcs/HTMLCS.js` to produce the changes shown below.
305
+
306
+ The changes in `htmlcs/HTMLCS.js` are:
307
+
308
+ ```diff
309
+ 479a480
310
+ > '4_1_2_attribute': 'attribute',
311
+ 6482a6484
312
+ > var messageStrings = new Set();
313
+ 6496d6497
314
+ < console.log('done');
315
+ 6499d6499
316
+ < console.log('done');
317
+ 6500a6501
318
+ > return Array.from(messageStrings);
319
+ 6531c6532,6534
320
+ < console.log('[HTMLCS] ' + typeName + '|' + msg.code + '|' + nodeName + '|' + elementId + '|' + msg.msg + '|' + html);
321
+ ---
322
+ > messageStrings.add(
323
+ > typeName + '|' + msg.code + '|' + nodeName + '|' + elementId + '|' + msg.msg + '|' + html
324
+ > );
325
+ ```
326
+
295
327
  ##### Branching
296
328
 
297
329
  An example of a **branching** command is:
@@ -611,6 +643,10 @@ Testaro omits some functionalities of Autotest, such as:
611
643
  - file operations for score aggregation, report revision, and HTML reports
612
644
  - a web user interface
613
645
 
646
+ ## Code style
647
+
648
+ The JavaScript code in this project generally conforms to the ESLint configuration file `.eslintrc`. However, the `htmlcs/HTMLCS.js` file implements an older version of JavaScript. Its style is regulated by the `htmlcs/.eslintrc.json` file.
649
+
614
650
  ## Origin
615
651
 
616
652
  Work on the custom tests in this package began in 2017, and work on the multi-package federation that Testaro implements began in early 2018. These two aspects were combined into the [Autotest](https://github.com/jrpool/autotest) package in early 2021 and into the more single-purpose packages, Testaro and Testilo, in January 2022.
@@ -0,0 +1,67 @@
1
+ {
2
+ "root": true,
3
+ "env": {
4
+ "browser": true,
5
+ "commonjs": true,
6
+ "es2021": true,
7
+ "node": true
8
+ },
9
+ "extends": "eslint:recommended",
10
+ "parserOptions": {
11
+ "ecmaVersion": 5
12
+ },
13
+ "rules": {
14
+ "indent": [
15
+ "error",
16
+ 2,
17
+ {
18
+ "MemberExpression": 0,
19
+ "ObjectExpression": "first"
20
+ }
21
+ ],
22
+ "linebreak-style": [
23
+ "error",
24
+ "unix"
25
+ ],
26
+ "quotes": [
27
+ "error",
28
+ "single"
29
+ ],
30
+ "semi": [
31
+ "error",
32
+ "always"
33
+ ],
34
+ "brace-style": [
35
+ "error",
36
+ "stroustrup"
37
+ ],
38
+ "no-undef": "off",
39
+ "no-redeclare": "off",
40
+ "no-unused-vars": "off",
41
+ "no-empty": "off",
42
+ "no-prototype-builtins": "off",
43
+ "no-cond-assign": "off",
44
+ "no-fallthrough": "off",
45
+ "no-constant-condition": "off",
46
+ "block-spacing": [
47
+ "error",
48
+ "never"
49
+ ],
50
+ "array-bracket-spacing": [
51
+ "error",
52
+ "never"
53
+ ],
54
+ "space-before-function-paren": [
55
+ "error",
56
+ "always"
57
+ ],
58
+ "space-in-parens": [
59
+ "error",
60
+ "never"
61
+ ],
62
+ "object-curly-spacing": [
63
+ "error",
64
+ "never"
65
+ ]
66
+ }
67
+ }