File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 55 "main" : " src/index.js" ,
66 "scripts" : {
77 "local" : " node -e 'import(\" ./src/index.js\" ).then(index => index.default()).then(events => events.onPostBuild());'" ,
8- "local-onsuccess" : " RUN_ON_SUCCESS =true node -e 'import(\" ./src/index.js\" ).then(index => index.default()).then(events => events.onSuccess());'" ,
8+ "local-onsuccess" : " LIGHTHOUSE_RUN_ON_SUCCESS =true node -e 'import(\" ./src/index.js\" ).then(index => index.default()).then(events => events.onSuccess());'" ,
99 "lint" : " eslint 'src/**/*.js'" ,
1010 "format" : " prettier --write 'src/**/*.js'" ,
1111 "test" : " node --experimental-vm-modules node_modules/jest/bin/jest.js --collect-coverage" ,
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import getUtils from './lib/get-utils/index.js';
66dotenv . config ( ) ;
77
88export default function lighthousePlugin ( inputs ) {
9- // Run onPostBuild by default, unless RUN_ON_SUCCESS is set to true
9+ // Run onPostBuild by default, unless LIGHTHOUSE_RUN_ON_SUCCESS env var is set to true, or run_on_success is specified in plugin inputs
1010 const defaultEvent =
11- inputs ?. run_on_success === 'true' || process . env . RUN_ON_SUCCESS === 'true'
11+ inputs ?. run_on_success === 'true' ||
12+ process . env . LIGHTHOUSE_RUN_ON_SUCCESS === 'true'
1213 ? 'onSuccess'
1314 : 'onPostBuild' ;
1415
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ describe('lighthousePlugin plugin events', () => {
1212
1313 describe ( 'onSuccess' , ( ) => {
1414 beforeEach ( ( ) => {
15- process . env . RUN_ON_SUCCESS = 'true' ;
15+ process . env . LIGHTHOUSE_RUN_ON_SUCCESS = 'true' ;
1616 } ) ;
1717 afterEach ( ( ) => {
18- delete process . env . RUN_ON_SUCCESS ;
18+ delete process . env . LIGHTHOUSE_RUN_ON_SUCCESS ;
1919 } ) ;
2020 it ( 'should return only the expected event function' , async ( ) => {
2121 const events = lighthousePlugin ( ) ;
You can’t perform that action at this time.
0 commit comments