Update tests, fix small bugs
MODIFY
packages/@romejs/codec-js-manifest/__rtests__/__rsnapshots__/dependencies.snap.md
packages/@romejs/codec-js-manifest/__rtests__/__rsnapshots__/dependencies.snap.md
# `dependencies.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/codec-js-manifest/__rtests__/dependencies.ts --update-snapshots` to update.
-
-## ```
-
-### ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/codec-js-manifest/__rtests__/dependencies.ts --update-snapshots` to update.
## `can parse npm dependency patterns`

MODIFY
packages/@romejs/codec-semver/__rtests__/__rsnapshots__/parse.snap.md
packages/@romejs/codec-semver/__rtests__/__rsnapshots__/parse.snap.md
# `parse.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/codec-semver/__rtests__/parse.ts --update-snapshots` to update.
-
-## ```
-
-### ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/codec-semver/__rtests__/parse.ts --update-snapshots` to update.
## `parse`

MODIFY
packages/@romejs/core/test-worker/SnapshotManager.ts
packages/@romejs/core/test-worker/SnapshotManager.ts
@@ -27,7 +27,7 @@ function cleanHeading(key: string): string {
}
if (key[key.length - 1] === '`') {
- key = key.slice(-1);
+ key = key.slice(0, -1);
}
return key.trim();
@@ -115,8 +115,6 @@ export default class SnapshotManager {
if (node.type === 'Heading' && node.level === 2) {
const testName = cleanHeading(node.text);
- const entries = new Map();
- this.entries.set(testName, entries);
while (nodes.length > 0) {
const node = nodes[0];
@@ -134,7 +132,9 @@ export default class SnapshotManager {
});
}
- entries.set(snapshotName, {
+ this.set({
+ testName,
+ snapshotName,
language: codeBlock.language,
value: codeBlock.text,
});
@@ -144,7 +144,9 @@ export default class SnapshotManager {
if (node.type === 'CodeBlock') {
nodes.shift();
- entries.set('0', {
+ this.set({
+ testName,
+ snapshotName: '0',
language: node.language,
value: node.text,
});
@@ -191,7 +193,7 @@ export default class SnapshotManager {
.relative(this.testPath)
.join();
lines.push(
- `DO NOT MODIFY. This file has been autogenerated. Run \`rome test ${relativeTestPath} --update-snapshots\` to update.`,
+ `**DO NOT MODIFY**. This file has been autogenerated. Run \`rome test ${relativeTestPath} --update-snapshots\` to update.`,
);
pushNewline();

MODIFY
packages/@romejs/core/test-worker/SnapshotParser.ts
packages/@romejs/core/test-worker/SnapshotParser.ts
@@ -119,7 +119,7 @@ export default createParser(
// Check for trailing newline
if (code[code.length - 1] === '\n') {
// Trim trailing newline
- code = code.slice(-1);
+ code = code.slice(0, -1);
// Skip closing ticks
end = add(end, 3);

MODIFY
packages/@romejs/js-ast-utils/__rtests__/__rsnapshots__/getCompletionRecords.snap.md
packages/@romejs/js-ast-utils/__rtests__/__rsnapshots__/getCompletionRecords.snap.md
# `getCompletionRecords.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/js-ast-utils/__rtests__/getCompletionRecords.ts --update-snapshots` to update.
-
-## ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/js-ast-utils/__rtests__/getCompletionRecords.ts --update-snapshots` to update.
## `completions`

MODIFY
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/analyzeDependencies.snap.md
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/analyzeDependencies.snap.md
# `analyzeDependencies.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/analyzeDependencies.ts --update-snapshots` to update.
-
-## ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/analyzeDependencies.ts --update-snapshots` to update.
## `correctly identifies a file with cjs exports as cjs`

MODIFY
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/lint.snap.md
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/lint.snap.md
# `lint.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/lint.ts --update-snapshots` to update.
-
-## ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/lint.ts --update-snapshots` to update.
## `disallow var`

MODIFY
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/suppressions.snap.md
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/suppressions.snap.md
# `suppressions.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/suppressions.ts --update-snapshots` to update.
-
-## ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/js-compiler/__rtests__/suppressions.ts --update-snapshots` to update.
## `multiple categories`

MODIFY
packages/@romejs/path-match/__rtests__/__rsnapshots__/parse.snap.md
packages/@romejs/path-match/__rtests__/__rsnapshots__/parse.snap.md
# `parse.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/path-match/__rtests__/parse.ts --update-snapshots` to update.
-
-## ```
-
-### ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/path-match/__rtests__/parse.ts --update-snapshots` to update.
## `pattern`

MODIFY
packages/@romejs/string-markup/__rtests__/__rsnapshots__/parse.snap.md
packages/@romejs/string-markup/__rtests__/__rsnapshots__/parse.snap.md
# `parse.ts`
-DO NOT MODIFY. This file has been autogenerated. Run `rome test packages/@romejs/string-markup/__rtests__/parse.ts --update-snapshots` to update.
-
-## ```
-
-```javascript
-
-
-```
+**DO NOT MODIFY**. This file has been autogenerated. Run `rome test packages/@romejs/string-markup/__rtests__/parse.ts --update-snapshots` to update.
## `should not parse string escapes`

Update tests, fix small bugs