apify-test-tools 0.4.0 → 0.5.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.
Files changed (53) hide show
  1. package/.prettierrc +5 -0
  2. package/.vscode/settings.json +3 -0
  3. package/CHANGELOG.md +14 -0
  4. package/bin/git.ts +11 -16
  5. package/bin/github.ts +5 -14
  6. package/bin/main.ts +38 -38
  7. package/bin/slack.ts +13 -16
  8. package/dist/bin/git.d.ts +2 -2
  9. package/dist/bin/git.d.ts.map +1 -1
  10. package/dist/bin/git.js +3 -6
  11. package/dist/bin/git.js.map +1 -1
  12. package/dist/bin/github.d.ts +1 -1
  13. package/dist/bin/github.d.ts.map +1 -1
  14. package/dist/bin/github.js +3 -9
  15. package/dist/bin/github.js.map +1 -1
  16. package/dist/bin/main.js +5 -7
  17. package/dist/bin/main.js.map +1 -1
  18. package/dist/bin/slack.d.ts +2 -2
  19. package/dist/bin/slack.d.ts.map +1 -1
  20. package/dist/bin/slack.js +4 -2
  21. package/dist/bin/slack.js.map +1 -1
  22. package/dist/lib/consts.d.ts +1 -1
  23. package/dist/lib/consts.d.ts.map +1 -1
  24. package/dist/lib/consts.js +2 -4
  25. package/dist/lib/consts.js.map +1 -1
  26. package/dist/lib/extend-expect.d.ts.map +1 -1
  27. package/dist/lib/extend-expect.js +11 -0
  28. package/dist/lib/extend-expect.js.map +1 -1
  29. package/dist/lib/lib.d.ts +1 -1
  30. package/dist/lib/lib.d.ts.map +1 -1
  31. package/dist/lib/lib.js +10 -7
  32. package/dist/lib/lib.js.map +1 -1
  33. package/dist/lib/run-test-result.d.ts +1 -1
  34. package/dist/lib/run-test-result.d.ts.map +1 -1
  35. package/dist/lib/run-test-result.js +1 -0
  36. package/dist/lib/run-test-result.js.map +1 -1
  37. package/dist/lib/types.d.ts +4 -0
  38. package/dist/lib/types.d.ts.map +1 -1
  39. package/dist/test/unit/custom-matchers.test.js +2 -2
  40. package/dist/test/unit/custom-matchers.test.js.map +1 -1
  41. package/dist/test/unit/parse-commit.test.js +5 -5
  42. package/dist/test/unit/parse-commit.test.js.map +1 -1
  43. package/dist/tsconfig.tsbuildinfo +1 -1
  44. package/lib/consts.ts +3 -5
  45. package/lib/extend-expect.ts +37 -22
  46. package/lib/lib.ts +29 -40
  47. package/lib/run-test-result.ts +9 -10
  48. package/lib/types.ts +70 -67
  49. package/package.json +4 -1
  50. package/test/unit/custom-matchers.test.ts +6 -9
  51. package/test/unit/parse-commit.test.ts +6 -7
  52. package/tsconfig.json +4 -8
  53. package/test/unit/test-actor.test.ts +0 -17
@@ -1,8 +1,7 @@
1
1
  import { describe, it, expect } from 'vitest';
2
- import { GIT_FORMAT_SEPARATOR, parseCommit } from '../../bin/git';
2
+ import { GIT_FORMAT_SEPARATOR, parseCommit } from '../../bin/git.js';
3
3
 
4
4
  describe('parseCommit', () => {
5
-
6
5
  describe('valid commit strings', () => {
7
6
  it('should parse a basic commit string correctly', () => {
8
7
  const commitString = `abc123${GIT_FORMAT_SEPARATOR}John Doe<john@example.com>${GIT_FORMAT_SEPARATOR}Mon, 25 Dec 2023 10:30:00 +0100${GIT_FORMAT_SEPARATOR}Add new feature`;
@@ -13,7 +12,7 @@ describe('parseCommit', () => {
13
12
  sha: 'abc123',
14
13
  author: 'John Doe<john@example.com>',
15
14
  date: 'Mon, 25 Dec 2023 10:30:00 +0100',
16
- message: 'Add new feature'
15
+ message: 'Add new feature',
17
16
  });
18
17
  });
19
18
 
@@ -26,7 +25,7 @@ describe('parseCommit', () => {
26
25
  sha: 'def456',
27
26
  author: 'Jane Smith<jane@example.com>',
28
27
  date: 'Tue, 26 Dec 2023 14:15:00 +0100',
29
- message: 'test: commit with double quotes: \"'
28
+ message: 'test: commit with double quotes: "',
30
29
  });
31
30
  });
32
31
 
@@ -39,7 +38,7 @@ describe('parseCommit', () => {
39
38
  sha: 'jkl012',
40
39
  author: 'María García<maria@example.com>',
41
40
  date: 'Thu, 28 Dec 2023 16:20:00 +0100',
42
- message: 'Add émojis 🚀 and "special" chars'
41
+ message: 'Add émojis 🚀 and "special" chars',
43
42
  });
44
43
  });
45
44
 
@@ -52,7 +51,7 @@ describe('parseCommit', () => {
52
51
  sha: 'mno345',
53
52
  author: 'Test User<test@example.com>',
54
53
  date: 'Fri, 29 Dec 2023 11:00:00 +0100',
55
- message: ''
54
+ message: '',
56
55
  });
57
56
  });
58
57
  });
@@ -70,4 +69,4 @@ describe('parseCommit', () => {
70
69
  expect(() => parseCommit(commitString)).toThrow(`Failed to parse commit string: ${commitString}`);
71
70
  });
72
71
  });
73
- });
72
+ });
package/tsconfig.json CHANGED
@@ -2,19 +2,15 @@
2
2
  "extends": "@apify/tsconfig",
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
- "module": "ES2022",
5
+ "module": "nodenext",
6
+ "moduleResolution": "nodenext",
6
7
  "target": "ES2022",
7
8
  "outDir": "dist",
8
9
  "noUnusedLocals": false,
9
10
  "strict": true,
10
11
  "esModuleInterop": true,
11
12
  "lib": ["DOM", "es2021"],
12
- "skipLibCheck": true,
13
+ "skipLibCheck": true
13
14
  },
14
- "include": [
15
- "./index.ts",
16
- "./bin/**/*",
17
- "./lib/**/*",
18
- "./test/**/*",
19
- ]
15
+ "include": ["./index.ts", "./bin/**/*", "./lib/**/*", "./test/**/*"]
20
16
  }
@@ -1,17 +0,0 @@
1
- import { describe, testActor } from '../../lib/lib';
2
-
3
- describe('testActor tests', async () => {
4
- testActor('compass/google-maps-extractor', 'basic', async ({ expect, run }) => {
5
- const runResult = await run({
6
- input: {},
7
- prefilledInput: true,
8
- options: {
9
- memory: 512,
10
- },
11
- })
12
- const input = await runResult.getInput<{ maxCrawledPlacesPerSearch: number }>();
13
- await expect(runResult).toFinishWith({
14
- datasetItemCount: input.maxCrawledPlacesPerSearch,
15
- })
16
- });
17
- });