Skip to content

Commit 0aab575

Browse files
committed
Convert project to use ESM instead of CJS
- update files to use ESM - update imports - update configurations - fix jest
1 parent 62516aa commit 0aab575

17 files changed

+4132
-4340
lines changed

__tests__/table.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {parseTestReports} from '../src/testParser'
2-
import {buildSummaryTables} from '../src/table'
1+
import {parseTestReports} from '../src/testParser.js'
2+
import {buildSummaryTables} from '../src/table.js'
33

44
/**
55
* Copyright Mike Penz

__tests__/testParser.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {parseFile, parseTestReports, resolveFileAndLine, resolvePath, Transformer} from '../src/testParser'
1+
import {parseFile, parseTestReports, resolveFileAndLine, resolvePath, Transformer} from '../src/testParser.js'
22

33
/**
44
* Original test cases:
@@ -242,9 +242,9 @@ describe('parseFile', () => {
242242
annotation_level: 'failure',
243243
status: 'failure',
244244
title: 'test_sample.test_which_fails',
245-
message: "AssertionError: assert 'test' == 'xyz'\n - xyz\n + test",
245+
message: 'AssertionError: assert \'test\' == \'xyz\'\n - xyz\n + test',
246246
raw_details:
247-
"def test_which_fails():\n event = { 'attr': 'test'}\n> assert event['attr'] == 'xyz'\nE AssertionError: assert 'test' == 'xyz'\nE - xyz\nE + test\n\npython/test_sample.py:10: AssertionError"
247+
'def test_which_fails():\n event = { \'attr\': \'test\'}\n> assert event[\'attr\'] == \'xyz\'\nE AssertionError: assert \'test\' == \'xyz\'\nE - xyz\nE + test\n\npython/test_sample.py:10: AssertionError'
248248
},
249249
{
250250
path: 'test_results/python/test_sample.py',
@@ -256,9 +256,9 @@ describe('parseFile', () => {
256256
annotation_level: 'failure',
257257
status: 'failure',
258258
title: 'test_sample.test_with_error',
259-
message: "AttributeError: 'dict' object has no attribute 'attr'",
259+
message: 'AttributeError: \'dict\' object has no attribute \'attr\'',
260260
raw_details:
261-
"def test_with_error():\n event = { 'attr': 'test'}\n> assert event.attr == 'test'\nE AttributeError: 'dict' object has no attribute 'attr'\n\npython/test_sample.py:14: AttributeError"
261+
'def test_with_error():\n event = { \'attr\': \'test\'}\n> assert event.attr == \'test\'\nE AttributeError: \'dict\' object has no attribute \'attr\'\n\npython/test_sample.py:14: AttributeError'
262262
}
263263
])
264264
})
@@ -292,9 +292,9 @@ describe('parseFile', () => {
292292
annotation_level: 'failure',
293293
status: 'failure',
294294
title: 'pytest/test_which_fails',
295-
message: "AssertionError: assert 'test' == 'xyz'\n - xyz\n + test",
295+
message: 'AssertionError: assert \'test\' == \'xyz\'\n - xyz\n + test',
296296
raw_details:
297-
"def test_which_fails():\n event = { 'attr': 'test'}\n> assert event['attr'] == 'xyz'\nE AssertionError: assert 'test' == 'xyz'\nE - xyz\nE + test\n\npython/test_sample.py:10: AssertionError"
297+
'def test_which_fails():\n event = { \'attr\': \'test\'}\n> assert event[\'attr\'] == \'xyz\'\nE AssertionError: assert \'test\' == \'xyz\'\nE - xyz\nE + test\n\npython/test_sample.py:10: AssertionError'
298298
},
299299
{
300300
path: 'subproject/test_results/python/test_sample.py',
@@ -306,9 +306,9 @@ describe('parseFile', () => {
306306
annotation_level: 'failure',
307307
status: 'failure',
308308
title: 'pytest/test_with_error',
309-
message: "AttributeError: 'dict' object has no attribute 'attr'",
309+
message: 'AttributeError: \'dict\' object has no attribute \'attr\'',
310310
raw_details:
311-
"def test_with_error():\n event = { 'attr': 'test'}\n> assert event.attr == 'test'\nE AttributeError: 'dict' object has no attribute 'attr'\n\npython/test_sample.py:14: AttributeError"
311+
'def test_with_error():\n event = { \'attr\': \'test\'}\n> assert event.attr == \'test\'\nE AttributeError: \'dict\' object has no attribute \'attr\'\n\npython/test_sample.py:14: AttributeError'
312312
}
313313
])
314314
})

__tests__/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {readTransformers} from '../src/utils'
1+
import {readTransformers} from '../src/utils.js'
22

33
/**
44
* Copyright 2024 Mike Penz

0 commit comments

Comments
 (0)