Skip to content

Commit

Permalink
test: Add test for import from test-resources in library
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Mar 15, 2024
1 parent fe4b99d commit 8b19da4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sap.ui.define(["sap/m/Button"], function (Button) {
"use strict";

return {
createButton: () => new Button()
};
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sap.ui.define(["library/with/custom/paths/ButtonFactory"], function (ButtonFactory) {
"use strict";

ButtonFactory.createButton().attachTap(function (event) {
alert(event.getSource());
});
});
26 changes: 26 additions & 0 deletions test/lib/linter/snapshots/linter.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,14 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
[
{
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'src/main/js/ButtonFactory.js',
messages: [],
warningCount: 0,
},
{
coverageInfo: [
{
Expand Down Expand Up @@ -909,6 +917,24 @@ Generated by [AVA](https://avajs.dev).
],
warningCount: 0,
},
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'src/test/js/ButtonFactory.js',
messages: [
{
column: 2,
fatal: undefined,
line: 4,
message: 'Call to deprecated function \'attachTap\' of class \'Button\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
{
coverageInfo: [
{
Expand Down
Binary file modified test/lib/linter/snapshots/linter.ts.snap
Binary file not shown.

0 comments on commit 8b19da4

Please sign in to comment.