File size: 698 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { getShellRc } = require( '../lib' );

module.exports = {
	title: 'Skip Playwright download',
	group: 'Node.js',
	description: 'Do not download Playwright',
	test: ( { pass, fail, ignore } ) => {
		if ( process.platform !== 'darwin' && process.platform !== 'linux' ) {
			ignore( 'This evaluation only works in OSX or Linux' );
			return;
		}

		if ( ! process.env.PLAYWRIGHT_SKIP_DOWNLOAD ) {
			fail( 'PLAYWRIGHT_SKIP_DOWNLOAD is not set' );
			return;
		}

		pass();
	},
	fix: () => {
		const shell = getShellRc();
		if ( shell ) {
			return `Add \`export PLAYWRIGHT_SKIP_DOWNLOAD=true\` to ${ shell }`;
		}
		return 'Set env variable `PLAYWRIGHT_SKIP_DOWNLOAD` with value `true`';
	},
};