Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests for comments on runtime code within imports #89

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/ImportCommentsPreserved/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,41 @@ import {
} from "d_proving_all_specifier_blank_lines_get_removed";

`;

exports[`inner-comment-on-declaration.ts - typescript-verify > inner-comment-on-declaration.ts 1`] = `
const someRandomGlobal = "stuff"; // same-line comment on someRandomGlobal

import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";

const someRandomGlobal = "stuff"; // same-line comment on someRandomGlobal

`;

exports[`leading-comments-on-declaration.ts - typescript-verify > leading-comments-on-declaration.ts 1`] = `
#!/usr/bin/env ts-node

// Leading comment on someRandomGlobal
const someRandomGlobal = "stuff";

import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/env ts-node

import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";

// Leading comment on someRandomGlobal
const someRandomGlobal = "stuff";

`;
6 changes: 6 additions & 0 deletions tests/ImportCommentsPreserved/inner-comment-on-declaration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const someRandomGlobal = "stuff"; // same-line comment on someRandomGlobal

import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env ts-node

// Leading comment on someRandomGlobal
const someRandomGlobal = "stuff";

import * as fs from "fs";
import * as path from "path";
import shell from "shelljs";