ava 4.3.2 → 4.3.3

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.
@@ -61,7 +61,7 @@ function findTest(locations, declaration) {
61
61
  const range = (start, end) => Array.from({length: end - start + 1}).fill(start).map((element, index) => element + index);
62
62
 
63
63
  const translate = (sourceMap, pos) => {
64
- if (sourceMap === undefined) {
64
+ if (sourceMap === null) {
65
65
  return pos;
66
66
  }
67
67
 
@@ -88,7 +88,7 @@ export default function lineNumberSelection({file, lineNumbers = []}) {
88
88
 
89
89
  let locations = parse(file);
90
90
  let lookedForSourceMap = false;
91
- let sourceMap;
91
+ let sourceMap = null;
92
92
 
93
93
  return () => {
94
94
  if (!lookedForSourceMap) {
@@ -98,7 +98,13 @@ export default function lineNumberSelection({file, lineNumbers = []}) {
98
98
  // Source maps are not available before then.
99
99
  sourceMap = findSourceMap(file);
100
100
 
101
- if (sourceMap !== undefined) {
101
+ if (sourceMap === undefined) {
102
+ // Prior to Node.js 18.8.0, the value when a source map could not be found was `undefined`.
103
+ // This changed to `null` in <https://github.com/nodejs/node/pull/43875>.
104
+ sourceMap = null;
105
+ }
106
+
107
+ if (sourceMap !== null) {
102
108
  locations = locations.map(({start, end}) => ({
103
109
  start: translate(sourceMap, start),
104
110
  end: translate(sourceMap, end),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ava",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "description": "Node.js test runner that lets you develop with confidence.",
5
5
  "license": "MIT",
6
6
  "repository": "avajs/ava",