diff --git a/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/ButtonFactory.js b/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/ButtonFactory.js new file mode 100644 index 000000000..ab86dc330 --- /dev/null +++ b/test/fixtures/linter/projects/library.with.custom.paths/src/main/js/ButtonFactory.js @@ -0,0 +1,7 @@ +sap.ui.define(["sap/m/Button"], function (Button) { + "use strict"; + + return { + createButton: () => new Button() + }; +}); diff --git a/test/fixtures/linter/projects/library.with.custom.paths/src/test/js/ButtonFactory.js b/test/fixtures/linter/projects/library.with.custom.paths/src/test/js/ButtonFactory.js new file mode 100644 index 000000000..794c1c96a --- /dev/null +++ b/test/fixtures/linter/projects/library.with.custom.paths/src/test/js/ButtonFactory.js @@ -0,0 +1,7 @@ +sap.ui.define(["library/with/custom/paths/ButtonFactory"], function (ButtonFactory) { + "use strict"; + + ButtonFactory.createButton().attachTap(function (event) { + alert(event.getSource()); + }); +}); diff --git a/test/lib/linter/snapshots/linter.ts.md b/test/lib/linter/snapshots/linter.ts.md index be0f01704..9109f30c9 100644 --- a/test/lib/linter/snapshots/linter.ts.md +++ b/test/lib/linter/snapshots/linter.ts.md @@ -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: [ { @@ -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: [ { diff --git a/test/lib/linter/snapshots/linter.ts.snap b/test/lib/linter/snapshots/linter.ts.snap index df7b0f89a..87d51b2c9 100644 Binary files a/test/lib/linter/snapshots/linter.ts.snap and b/test/lib/linter/snapshots/linter.ts.snap differ