Skip to content

Commit

Permalink
feat: Add tests for application/javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Apr 9, 2024
1 parent 0cd6efb commit 93495c6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions test/fixtures/linter/rules/CSPCompliance/NoInlineJS.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
});
</script>

<script type="application/javascript">
sap.ui.controller("my.own.controller", {
doSomething: function () {
alert("Hello World!");
}
});
</script>

<script type="">
(function() {
alert("test")
Expand Down
Binary file modified test/lib/detectors/transpilers/xml/snapshots/transpiler.ts.snap
Binary file not shown.
13 changes: 11 additions & 2 deletions test/lib/linter/rules/snapshots/CSPCompliance.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,23 @@ Generated by [AVA](https://avajs.dev).
{
column: 2,
fatal: undefined,
line: 23,
line: 25,
message: 'Use of unsafe inline script',
messageDetails: 'Content Security Policy (https://ui5.sap.com/1.120/#/topic/fe1a6dba940e479fb7c3bc753f92b28c)',
ruleId: 'ui5-linter-csp-unsafe-inline-script',
severity: 1,
},
{
column: 2,
fatal: undefined,
line: 31,
message: 'Use of unsafe inline script',
messageDetails: 'Content Security Policy (https://ui5.sap.com/1.120/#/topic/fe1a6dba940e479fb7c3bc753f92b28c)',
ruleId: 'ui5-linter-csp-unsafe-inline-script',
severity: 1,
},
],
warningCount: 3,
warningCount: 4,
},
]

Expand Down
Binary file modified test/lib/linter/rules/snapshots/CSPCompliance.ts.snap
Binary file not shown.
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.
Binary file modified test/lib/linter/rules/snapshots/NoGlobals.ts.snap
Binary file not shown.
Binary file modified test/lib/linter/snapshots/linter.ts.snap
Binary file not shown.

0 comments on commit 93495c6

Please sign in to comment.