Skip to content

Commit

Permalink
Merge pull request #254 from WordPress-Coding-Standards/greenkeeper/@…
Browse files Browse the repository at this point in the history
…wordpress/scripts-7.0.0

Update @wordpress/scripts to the latest version 🚀
  • Loading branch information
ntwb committed May 31, 2020
1 parent d094e6b commit 76c9b7e
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 178 deletions.
2 changes: 1 addition & 1 deletion packages/stylelint-config-wordpress/.gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text eol=auto
* text=auto eol=lf
25 changes: 12 additions & 13 deletions packages/stylelint-config-wordpress/__tests__/commenting.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const fs = require( 'fs' ),
config = require( '../' ),
stylelint = require( 'stylelint' ),
validCss = fs.readFileSync( './__tests__/commenting-valid.css', 'utf-8' ),
invalidCss = fs.readFileSync( './__tests__/commenting-invalid.css', 'utf-8' );
invalidCss = fs.readFileSync(
'./__tests__/commenting-invalid.css',
'utf-8'
);

describe( 'flags no warnings with valid commenting css', () => {
let result;
Expand All @@ -17,15 +20,13 @@ describe( 'flags no warnings with valid commenting css', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +41,18 @@ describe( 'flags warnings with invalid commenting css', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 3 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
25 changes: 12 additions & 13 deletions packages/stylelint-config-wordpress/__tests__/functions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const fs = require( 'fs' ),
config = require( '../' ),
stylelint = require( 'stylelint' ),
validCss = fs.readFileSync( './__tests__/functions-valid.css', 'utf-8' ),
invalidCss = fs.readFileSync( './__tests__/functions-invalid.css', 'utf-8' );
invalidCss = fs.readFileSync(
'./__tests__/functions-invalid.css',
'utf-8'
);

describe( 'flags no warnings with valid functions css', () => {
let result;
Expand All @@ -17,15 +20,13 @@ describe( 'flags no warnings with valid functions css', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +41,18 @@ describe( 'flags warnings with invalid functions css', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 1 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
20 changes: 8 additions & 12 deletions packages/stylelint-config-wordpress/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ describe( 'flags no warnings with valid css', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +38,18 @@ describe( 'flags warnings with invalid css', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 1 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
30 changes: 16 additions & 14 deletions packages/stylelint-config-wordpress/__tests__/media-queries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
const fs = require( 'fs' ),
config = require( '../' ),
stylelint = require( 'stylelint' ),
validCss = fs.readFileSync( './__tests__/media-queries-valid.css', 'utf-8' ),
invalidCss = fs.readFileSync( './__tests__/media-queries-invalid.css', 'utf-8' );
validCss = fs.readFileSync(
'./__tests__/media-queries-valid.css',
'utf-8'
),
invalidCss = fs.readFileSync(
'./__tests__/media-queries-invalid.css',
'utf-8'
);

describe( 'flags no warnings with valid media queries css', () => {
let result;
Expand All @@ -17,15 +23,13 @@ describe( 'flags no warnings with valid media queries css', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +44,18 @@ describe( 'flags warnings with invalid media queries css', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 11 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
25 changes: 12 additions & 13 deletions packages/stylelint-config-wordpress/__tests__/properties.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const fs = require( 'fs' ),
config = require( '../' ),
stylelint = require( 'stylelint' ),
validCss = fs.readFileSync( './__tests__/properties-valid.css', 'utf-8' ),
invalidCss = fs.readFileSync( './__tests__/properties-invalid.css', 'utf-8' );
invalidCss = fs.readFileSync(
'./__tests__/properties-invalid.css',
'utf-8'
);

describe( 'flags no warnings with valid properties css', () => {
let result;
Expand All @@ -17,15 +20,13 @@ describe( 'flags no warnings with valid properties css', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +41,18 @@ describe( 'flags warnings with invalid properties css', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 7 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
16 changes: 6 additions & 10 deletions packages/stylelint-config-wordpress/__tests__/scss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ describe( 'flags no warnings with valid scss', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,15 +38,13 @@ describe( 'flags warnings with invalid scss', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 8 )
) );
);
} );

// ToDo: Fix snapshot, as results differ between Node.js v10 & v12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const fs = require( 'fs' ),
config = require( '../scss.js' ),
stylelint = require( 'stylelint' ),
validScss = fs.readFileSync( './__tests__/selectors-valid.scss', 'utf-8' ),
invalidScss = fs.readFileSync( './__tests__/selectors-invalid.scss', 'utf-8' );
invalidScss = fs.readFileSync(
'./__tests__/selectors-invalid.scss',
'utf-8'
);

describe( 'flags no warnings with valid selectors scss', () => {
let result;
Expand All @@ -17,15 +20,13 @@ describe( 'flags no warnings with valid selectors scss', () => {
} );

it( 'did not error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeFalsy()
) );
return result.then( ( data ) => expect( data.errored ).toBeFalsy() );
} );

it( 'flags no warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 0 )
) );
);
} );
} );

Expand All @@ -40,20 +41,18 @@ describe( 'flags warnings with invalid selectors scss', () => {
} );

it( 'did error', () => {
return result.then( ( data ) => (
expect( data.errored ).toBeTruthy()
) );
return result.then( ( data ) => expect( data.errored ).toBeTruthy() );
} );

it( 'flags correct number of warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toHaveLength( 6 )
) );
);
} );

it( 'snapshot matches warnings', () => {
return result.then( ( data ) => (
return result.then( ( data ) =>
expect( data.results[ 0 ].warnings ).toMatchSnapshot()
) );
);
} );
} );
Loading

0 comments on commit 76c9b7e

Please sign in to comment.