@as-pect/csv-reporter 6.2.0 → 7.0.1

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/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- import stringify, { Stringifier } from "csv-stringify";
1
+ import { Stringifier, stringify } from "csv-stringify";
2
2
  import { WriteStream, createWriteStream } from "fs";
3
3
  import { basename, extname, dirname, join } from "path";
4
- import { TestNodeType, TestContext, IReporter, TestNode } from "@as-pect/core";
4
+ import { TestNodeType, TestContext, IReporter, TestNode, IWritable } from "@as-pect/core";
5
5
 
6
6
  /**
7
7
  * This is a list of all the columns in the exported csv file.
@@ -22,7 +22,10 @@ const csvColumns = [
22
22
  * This class is responsible for creating a csv file located at {testName}.spec.csv. It will
23
23
  * contain a set of tests with relevant pass and fail information.
24
24
  */
25
- module.exports = class CSVReporter implements IReporter {
25
+ export default class CSVReporter implements IReporter {
26
+ public stdout: IWritable | null = null;
27
+ public stderr: IWritable | null = null;
28
+
26
29
  protected output: Stringifier | null = null;
27
30
  protected fileName: WriteStream | null = null;
28
31
 
@@ -1,2 +1,21 @@
1
- declare module "index" { }
1
+ /// <reference types="node" />
2
+ declare module "index" {
3
+ import { Stringifier } from "csv-stringify";
4
+ import { WriteStream } from "fs";
5
+ import { TestContext, IReporter, TestNode } from "@as-pect/core";
6
+ /**
7
+ * This class is responsible for creating a csv file located at {testName}.spec.csv. It will
8
+ * contain a set of tests with relevant pass and fail information.
9
+ */
10
+ export default class CSVReporter implements IReporter {
11
+ protected output: Stringifier | null;
12
+ protected fileName: WriteStream | null;
13
+ onEnter(ctx: TestContext): void;
14
+ onExit(_ctx: TestContext, node: TestNode): void;
15
+ onFinish(): void;
16
+ protected onGroupFinish(group: TestNode): void;
17
+ protected onTestFinish(group: TestNode, test: TestNode): void;
18
+ protected onTodo(group: TestNode, desc: string): void;
19
+ }
20
+ }
2
21
  //# sourceMappingURL=as-pect.csv-reporter.amd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"as-pect.csv-reporter.amd.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"as-pect.csv-reporter.amd.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;IAAA,OAAO,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;IACvD,OAAO,EAAE,WAAW,EAAqB,MAAM,IAAI,CAAC;IAEpD,OAAO,EAAgB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;IAiB/E;;;OAGG;IACH,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,SAAS;QACnD,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;QAC5C,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAQ;QAEvC,OAAO,CAAC,KAAK,WAAW,GAAG,IAAI;QAW/B,MAAM,CAAC,MAAM,WAAW,EAAE,MAAM,QAAQ,GAAG,IAAI;QAM/C,QAAQ,IAAI,IAAI;QAIvB,SAAS,CAAC,aAAa,CAAC,OAAO,QAAQ,GAAG,IAAI;QAO9C,SAAS,CAAC,YAAY,CAAC,OAAO,QAAQ,EAAE,MAAM,QAAQ;QAkBtD,SAAS,CAAC,MAAM,CAAC,OAAO,QAAQ,EAAE,MAAM,MAAM;KAG/C"}
@@ -1,14 +1,10 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
1
  define("index", ["require", "exports", "csv-stringify", "fs", "path"], function (require, exports, csv_stringify_1, fs_1, path_1) {
5
2
  "use strict";
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
- csv_stringify_1 = __importDefault(csv_stringify_1);
8
4
  /**
9
5
  * This is a list of all the columns in the exported csv file.
10
6
  */
11
- var csvColumns = [
7
+ const csvColumns = [
12
8
  "Group",
13
9
  "Name",
14
10
  "Ran",
@@ -23,37 +19,34 @@ define("index", ["require", "exports", "csv-stringify", "fs", "path"], function
23
19
  * This class is responsible for creating a csv file located at {testName}.spec.csv. It will
24
20
  * contain a set of tests with relevant pass and fail information.
25
21
  */
26
- module.exports = /** @class */ (function () {
27
- function CSVReporter() {
28
- this.output = null;
29
- this.fileName = null;
30
- }
31
- CSVReporter.prototype.onEnter = function (ctx) {
32
- this.output = csv_stringify_1.default({ columns: csvColumns });
33
- var extension = path_1.extname(ctx.fileName);
34
- var dir = path_1.dirname(ctx.fileName);
35
- var base = path_1.basename(ctx.fileName, extension);
36
- var outPath = path_1.join(process.cwd(), dir, base + ".csv");
37
- this.fileName = fs_1.createWriteStream(outPath, "utf8");
22
+ class CSVReporter {
23
+ output = null;
24
+ fileName = null;
25
+ onEnter(ctx) {
26
+ this.output = (0, csv_stringify_1.stringify)({ columns: csvColumns });
27
+ const extension = (0, path_1.extname)(ctx.fileName);
28
+ const dir = (0, path_1.dirname)(ctx.fileName);
29
+ const base = (0, path_1.basename)(ctx.fileName, extension);
30
+ const outPath = (0, path_1.join)(process.cwd(), dir, base + ".csv");
31
+ this.fileName = (0, fs_1.createWriteStream)(outPath, "utf8");
38
32
  this.output.pipe(this.fileName);
39
33
  this.output.write(csvColumns);
40
- };
41
- CSVReporter.prototype.onExit = function (_ctx, node) {
42
- if (node.type === 1 /* Group */) {
34
+ }
35
+ onExit(_ctx, node) {
36
+ if (node.type === 1 /* TestNodeType.Group */) {
43
37
  this.onGroupFinish(node);
44
38
  }
45
- };
46
- CSVReporter.prototype.onFinish = function () {
39
+ }
40
+ onFinish() {
47
41
  this.output.end();
48
- };
49
- CSVReporter.prototype.onGroupFinish = function (group) {
50
- var _this = this;
42
+ }
43
+ onGroupFinish(group) {
51
44
  if (group.children.length === 0)
52
45
  return;
53
- group.groupTests.forEach(function (test) { return _this.onTestFinish(group, test); });
54
- group.groupTodos.forEach(function (desc) { return _this.onTodo(group, desc); });
55
- };
56
- CSVReporter.prototype.onTestFinish = function (group, test) {
46
+ group.groupTests.forEach((test) => this.onTestFinish(group, test));
47
+ group.groupTodos.forEach((desc) => this.onTodo(group, desc));
48
+ }
49
+ onTestFinish(group, test) {
57
50
  this.output.write([
58
51
  group.name,
59
52
  test.ran ? "RAN" : "NOT RUN",
@@ -64,16 +57,17 @@ define("index", ["require", "exports", "csv-stringify", "fs", "path"], function
64
57
  test.message,
65
58
  test.actual ? test.actual.stringify({ indent: 0 }) : "",
66
59
  test.expected
67
- ? "" + (test.negated ? "Not " : "") + test.expected.stringify({
60
+ ? `${test.negated ? "Not " : ""}${test.expected.stringify({
68
61
  indent: 0,
69
- })
62
+ })}`
70
63
  : "",
71
64
  ]);
72
- };
73
- CSVReporter.prototype.onTodo = function (group, desc) {
65
+ }
66
+ onTodo(group, desc) {
74
67
  this.output.write([group.name, "TODO", desc, "", "", "", "", "", ""]);
75
- };
76
- return CSVReporter;
77
- }());
68
+ }
69
+ }
70
+ exports.default = CSVReporter;
71
+ ;
78
72
  });
79
73
  //# sourceMappingURL=as-pect.csv-reporter.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"as-pect.csv-reporter.amd.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;IAKA;;OAEG;IACH,IAAM,UAAU,GAAG;QACjB,OAAO;QACP,MAAM;QACN,KAAK;QACL,SAAS;QACT,MAAM;QACN,SAAS;QACT,SAAS;QACT,QAAQ;QACR,UAAU;KACX,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAC,OAAO;QAAG;YACL,WAAM,GAAuB,IAAI,CAAC;YAClC,aAAQ,GAAuB,IAAI,CAAC;QAmDhD,CAAC;QAjDQ,6BAAO,GAAd,UAAe,GAAgB;YAC7B,IAAI,CAAC,MAAM,GAAG,uBAAS,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YACjD,IAAM,SAAS,GAAG,cAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxC,IAAM,GAAG,GAAG,cAAO,CAAC,GAAG,CAAC,QAAQ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+ import { Stringifier } from "csv-stringify";
3
+ import { WriteStream } from "fs";
4
+ import { TestContext, IReporter, TestNode, IWritable } from "@as-pect/core";
5
+ /**
6
+ * This class is responsible for creating a csv file located at {testName}.spec.csv. It will
7
+ * contain a set of tests with relevant pass and fail information.
8
+ */
9
+ export default class CSVReporter implements IReporter {
10
+ stdout: IWritable | null;
11
+ stderr: IWritable | null;
12
+ protected output: Stringifier | null;
13
+ protected fileName: WriteStream | null;
14
+ onEnter(ctx: TestContext): void;
15
+ onExit(_ctx: TestContext, node: TestNode): void;
16
+ onFinish(): void;
17
+ protected onGroupFinish(group: TestNode): void;
18
+ protected onTestFinish(group: TestNode, test: TestNode): void;
19
+ protected onTodo(group: TestNode, desc: string): void;
20
+ }
2
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,WAAW,EAAqB,MAAM,IAAI,CAAC;AAEpD,OAAO,EAAgB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAiB1F;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,SAAS;IAC5C,MAAM,EAAE,SAAS,GAAG,IAAI,CAAQ;IAChC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAQ;IAEvC,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;IAC5C,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAQ;IAEvC,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAW/B,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAM/C,QAAQ,IAAI,IAAI;IAIvB,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAO9C,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;IAkBtD,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM;CAG/C"}
package/lib/index.js CHANGED
@@ -1,15 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var csv_stringify_1 = __importDefault(require("csv-stringify"));
7
- var fs_1 = require("fs");
8
- var path_1 = require("path");
1
+ import { stringify } from "csv-stringify";
2
+ import { createWriteStream } from "fs";
3
+ import { basename, extname, dirname, join } from "path";
9
4
  /**
10
5
  * This is a list of all the columns in the exported csv file.
11
6
  */
12
- var csvColumns = [
7
+ const csvColumns = [
13
8
  "Group",
14
9
  "Name",
15
10
  "Ran",
@@ -24,37 +19,36 @@ var csvColumns = [
24
19
  * This class is responsible for creating a csv file located at {testName}.spec.csv. It will
25
20
  * contain a set of tests with relevant pass and fail information.
26
21
  */
27
- module.exports = /** @class */ (function () {
28
- function CSVReporter() {
29
- this.output = null;
30
- this.fileName = null;
31
- }
32
- CSVReporter.prototype.onEnter = function (ctx) {
33
- this.output = csv_stringify_1.default({ columns: csvColumns });
34
- var extension = path_1.extname(ctx.fileName);
35
- var dir = path_1.dirname(ctx.fileName);
36
- var base = path_1.basename(ctx.fileName, extension);
37
- var outPath = path_1.join(process.cwd(), dir, base + ".csv");
38
- this.fileName = fs_1.createWriteStream(outPath, "utf8");
22
+ export default class CSVReporter {
23
+ stdout = null;
24
+ stderr = null;
25
+ output = null;
26
+ fileName = null;
27
+ onEnter(ctx) {
28
+ this.output = stringify({ columns: csvColumns });
29
+ const extension = extname(ctx.fileName);
30
+ const dir = dirname(ctx.fileName);
31
+ const base = basename(ctx.fileName, extension);
32
+ const outPath = join(process.cwd(), dir, base + ".csv");
33
+ this.fileName = createWriteStream(outPath, "utf8");
39
34
  this.output.pipe(this.fileName);
40
35
  this.output.write(csvColumns);
41
- };
42
- CSVReporter.prototype.onExit = function (_ctx, node) {
43
- if (node.type === 1 /* Group */) {
36
+ }
37
+ onExit(_ctx, node) {
38
+ if (node.type === 1 /* TestNodeType.Group */) {
44
39
  this.onGroupFinish(node);
45
40
  }
46
- };
47
- CSVReporter.prototype.onFinish = function () {
41
+ }
42
+ onFinish() {
48
43
  this.output.end();
49
- };
50
- CSVReporter.prototype.onGroupFinish = function (group) {
51
- var _this = this;
44
+ }
45
+ onGroupFinish(group) {
52
46
  if (group.children.length === 0)
53
47
  return;
54
- group.groupTests.forEach(function (test) { return _this.onTestFinish(group, test); });
55
- group.groupTodos.forEach(function (desc) { return _this.onTodo(group, desc); });
56
- };
57
- CSVReporter.prototype.onTestFinish = function (group, test) {
48
+ group.groupTests.forEach((test) => this.onTestFinish(group, test));
49
+ group.groupTodos.forEach((desc) => this.onTodo(group, desc));
50
+ }
51
+ onTestFinish(group, test) {
58
52
  this.output.write([
59
53
  group.name,
60
54
  test.ran ? "RAN" : "NOT RUN",
@@ -65,15 +59,15 @@ module.exports = /** @class */ (function () {
65
59
  test.message,
66
60
  test.actual ? test.actual.stringify({ indent: 0 }) : "",
67
61
  test.expected
68
- ? "" + (test.negated ? "Not " : "") + test.expected.stringify({
62
+ ? `${test.negated ? "Not " : ""}${test.expected.stringify({
69
63
  indent: 0,
70
- })
64
+ })}`
71
65
  : "",
72
66
  ]);
73
- };
74
- CSVReporter.prototype.onTodo = function (group, desc) {
67
+ }
68
+ onTodo(group, desc) {
75
69
  this.output.write([group.name, "TODO", desc, "", "", "", "", "", ""]);
76
- };
77
- return CSVReporter;
78
- }());
70
+ }
71
+ }
72
+ ;
79
73
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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C,MAAM,CAAC,QAAQ,EAAE;YACtB,IAAI,CAAC,OAAO;YACZ,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;YACvD,IAAI,CAAC,QAAQ;gBACX,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;oBACtD,MAAM,EAAE,CAAC;iBACV,CAAC,EAAE;gBACN,CAAC,CAAC,EAAE;SACP,CAAC,CAAC;IACL,CAAC;IAES,MAAM,CAAC,KAAe,EAAE,IAAY;QAC5C,IAAI,CAAC,MAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAAA,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@as-pect/csv-reporter",
3
- "version": "6.2.0",
3
+ "version": "7.0.1",
4
4
  "description": "csv reporter for as-pect",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
+ "type": "module",
7
8
  "scripts": {
8
- "tsc:all": "run-p tsc:default tsc:amd",
9
- "tsc:amd": "tsc --outfile lib/as-pect.csv-reporter.amd.js --module amd --declaration --declarationMap",
10
- "tsc:default": "tsc",
9
+ "tsc:all": "tsc",
11
10
  "test": "exit 0"
12
11
  },
13
12
  "repository": {
@@ -17,10 +16,9 @@
17
16
  "author": "Joshua Tenner",
18
17
  "license": "MIT",
19
18
  "devDependencies": {
20
- "csv-stringify": "^5.6.2"
19
+ "csv-stringify": "^6.2.0"
21
20
  },
22
21
  "dependencies": {
23
- "@as-pect/core": "^6.2.0"
24
- },
25
- "gitHead": "fbe178add7c18e2c321cd8fb65d6c3ddc0e7f869"
22
+ "@as-pect/core": "^7.0.1"
23
+ }
26
24
  }
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Basic Options */
4
- "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
4
+ "target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5
+ "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6
6
  // "lib": [], /* Specify library files to be included in the compilation. */
7
7
  "allowJs": true, /* Allow javascript files to be compiled. */
8
8
  "checkJs": true, /* Report errors in .js files. */