Skip to content

Commit

Permalink
Convert project to use ESM instead of CJS
Browse files Browse the repository at this point in the history
- update files to use ESM
- update imports
- update configurations
- fix jest
  • Loading branch information
mikepenz committed Dec 15, 2024
1 parent 62516aa commit 0aab575
Show file tree
Hide file tree
Showing 17 changed files with 4,132 additions and 4,340 deletions.
4 changes: 2 additions & 2 deletions __tests__/table.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {parseTestReports} from '../src/testParser'
import {buildSummaryTables} from '../src/table'
import {parseTestReports} from '../src/testParser.js'
import {buildSummaryTables} from '../src/table.js'

/**
* Copyright Mike Penz
Expand Down
18 changes: 9 additions & 9 deletions __tests__/testParser.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {parseFile, parseTestReports, resolveFileAndLine, resolvePath, Transformer} from '../src/testParser'
import {parseFile, parseTestReports, resolveFileAndLine, resolvePath, Transformer} from '../src/testParser.js'

/**
* Original test cases:
Expand Down Expand Up @@ -242,9 +242,9 @@ describe('parseFile', () => {
annotation_level: 'failure',
status: 'failure',
title: 'test_sample.test_which_fails',
message: "AssertionError: assert 'test' == 'xyz'\n - xyz\n + test",
message: 'AssertionError: assert \'test\' == \'xyz\'\n - xyz\n + test',
raw_details:
"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"
'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'
},
{
path: 'test_results/python/test_sample.py',
Expand All @@ -256,9 +256,9 @@ describe('parseFile', () => {
annotation_level: 'failure',
status: 'failure',
title: 'test_sample.test_with_error',
message: "AttributeError: 'dict' object has no attribute 'attr'",
message: 'AttributeError: \'dict\' object has no attribute \'attr\'',
raw_details:
"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"
'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'
}
])
})
Expand Down Expand Up @@ -292,9 +292,9 @@ describe('parseFile', () => {
annotation_level: 'failure',
status: 'failure',
title: 'pytest/test_which_fails',
message: "AssertionError: assert 'test' == 'xyz'\n - xyz\n + test",
message: 'AssertionError: assert \'test\' == \'xyz\'\n - xyz\n + test',
raw_details:
"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"
'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'
},
{
path: 'subproject/test_results/python/test_sample.py',
Expand All @@ -306,9 +306,9 @@ describe('parseFile', () => {
annotation_level: 'failure',
status: 'failure',
title: 'pytest/test_with_error',
message: "AttributeError: 'dict' object has no attribute 'attr'",
message: 'AttributeError: \'dict\' object has no attribute \'attr\'',
raw_details:
"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"
'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'
}
])
})
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {readTransformers} from '../src/utils'
import {readTransformers} from '../src/utils.js'

/**
* Copyright 2024 Mike Penz
Expand Down
Loading

0 comments on commit 0aab575

Please sign in to comment.