1- import { TESTER_PLUGIN_REF } from "../../../constant.js" ;
2-
3- export function generateBootstrap ( options : {
4- port : number ;
5- startupDelay : number ;
6- waitForPlugin : string ;
7- } ) {
8- return `//Code generated by the zotero-plugin-scaffold tester
1+ /* eslint-disable eslint-comments/no-unlimited-disable */
2+ /* eslint-disable */
3+ // Code generated by the zotero-plugin-scaffold tester
94var chromeHandle ;
105
116function install ( data , reason ) { }
@@ -17,14 +12,14 @@ async function startup({ id, version, resourceURI, rootURI }, reason) {
1712 ] . getService ( Components . interfaces . amIAddonManagerStartup ) ;
1813 const manifestURI = Services . io . newURI ( rootURI + "manifest.json" ) ;
1914 chromeHandle = aomStartup . registerChrome ( manifestURI , [
20- ["content", "${ TESTER_PLUGIN_REF } ", rootURI + "content/"],
15+ [ "content" , "__TESTER_PLUGIN_REF__ " , rootURI + "content/" ] ,
2116 ] ) ;
2217
2318 launchTests ( ) . catch ( ( error ) => {
2419 Zotero . debug ( error ) ;
2520 Zotero . HTTP . request (
2621 "POST" ,
27- "http://localhost:${ options . port } /update",
22+ "http://localhost:__PORT__ /update" ,
2823 {
2924 body : JSON . stringify ( {
3025 type : "fail" ,
@@ -58,9 +53,9 @@ function uninstall(data, reason) {}
5853
5954async function launchTests ( ) {
6055 // Delay to allow plugin to fully load before opening the test page
61- await Zotero.Promise.delay(${ options . startupDelay || 1000 } );
56+ await Zotero . Promise . delay ( __STARTUP_DELAY__ ) ;
6257
63- const waitForPlugin = "${ options . waitForPlugin } ";
58+ const waitForPlugin = "${WAIT_FOR_PLUGIN }" ;
6459
6560 if ( waitForPlugin ) {
6661 // Wait for a plugin to be installed
@@ -98,5 +93,3 @@ function waitUtilAsync(condition, interval = 100, timeout = 1e4) {
9893 } , interval ) ;
9994 } ) ;
10095}
101- ` ;
102- }
0 commit comments