Skip to content

Commit

Permalink
Record test start in private API recorder
Browse files Browse the repository at this point in the history
This way we can use the same JSON output to find out which tests don’t
use any private APIs.
  • Loading branch information
lawrence-forooghian committed Jun 24, 2024
1 parent 8556734 commit 84a4e15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/common/modules/private_api_recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ define([], function () {
console.log(`(${loggingDescription}) Recorded private API: ${privateAPIIdentifier}`);
this.privateAPIUsages.push({ context, privateAPIIdentifier });
},
recordTestStart: () => {
console.log(`(${loggingDescription}) Recorded test start`);
this.privateAPIUsages.push({ context, privateAPIIdentifier: null });
}
};
}

Expand Down
4 changes: 4 additions & 0 deletions test/common/modules/shared_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ define([
return new this(this.createContext(context));
}

recordTestStart() {
this.privateApiContext.recordTestStart();
}

recordPrivateApi(identifier) {
this.privateApiContext.record(identifier);
}
Expand Down
1 change: 1 addition & 0 deletions test/support/root_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ define(['shared_helper'], function (Helper) {
});
beforeEach(function () {
this.helper = Helper.forTest(this);
this.helper.recordTestStart();
});
beforeEach(function () {
this.helper.clearTransportPreference();
Expand Down

0 comments on commit 84a4e15

Please sign in to comment.