Skip to content

Commit

Permalink
tests: add more assertions for getFilename() and `getPhysicalFilena…
Browse files Browse the repository at this point in the history
…me()`
  • Loading branch information
snitin315 committed Apr 29, 2023
1 parent ab439ff commit 012acae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/lib/linter/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6760,6 +6760,9 @@ var a = "test2";
linter.defineRule("report-original-text", {
create: context => ({
Program(ast) {
assert.strictEqual(context.getFilename(), context.filename);
assert.strictEqual(context.getPhysicalFilename(), context.physicalFilename);

receivedFilenames.push(context.filename);
receivedPhysicalFilenames.push(context.physicalFilename);
context.report({ node: ast, message: context.getSourceCode().text });
Expand Down Expand Up @@ -15564,6 +15567,9 @@ var a = "test2";
create(context) {
return {
Program(ast) {
assert.strictEqual(context.getFilename(), context.filename);
assert.strictEqual(context.getPhysicalFilename(), context.physicalFilename);

receivedFilenames.push(context.filename);
receivedPhysicalFilenames.push(context.physicalFilename);
context.report({ node: ast, message: context.getSourceCode().text });
Expand Down

0 comments on commit 012acae

Please sign in to comment.