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 5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
7
7
"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());'" ,
9
9
"lint" : " eslint 'src/**/*.js'" ,
10
10
"format" : " prettier --write 'src/**/*.js'" ,
11
11
"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';
6
6
dotenv . config ( ) ;
7
7
8
8
export 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
10
10
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'
12
13
? 'onSuccess'
13
14
: 'onPostBuild' ;
14
15
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ describe('lighthousePlugin plugin events', () => {
12
12
13
13
describe ( 'onSuccess' , ( ) => {
14
14
beforeEach ( ( ) => {
15
- process . env . RUN_ON_SUCCESS = 'true' ;
15
+ process . env . LIGHTHOUSE_RUN_ON_SUCCESS = 'true' ;
16
16
} ) ;
17
17
afterEach ( ( ) => {
18
- delete process . env . RUN_ON_SUCCESS ;
18
+ delete process . env . LIGHTHOUSE_RUN_ON_SUCCESS ;
19
19
} ) ;
20
20
it ( 'should return only the expected event function' , async ( ) => {
21
21
const events = lighthousePlugin ( ) ;
You can’t perform that action at this time.
0 commit comments