@@ -871,24 +871,6 @@ t.test('audit signatures', async t => {
871871 t . matchSnapshot ( joinedOutput ( ) )
872872 } )
873873
874- t . test ( 'with colour option and invalid signatures' , async t => {
875- npm . prefix = validInstall ( )
876- npm . color = true
877- await manifestWithInvalidSigs ( )
878- validKeys ( )
879-
880- await audit . exec ( [ 'signatures' ] )
881-
882- t . equal ( process . exitCode , 1 , 'should exit with error' )
883- process . exitCode = 0
884- t . match (
885- joinedOutput ( ) ,
886- /* eslint-disable-next-line no-control-regex */
887- / \u001b \[ 1 m \u001b \[ 3 1 m i n v a l i d \u001b \[ 3 9 m \u001b \[ 2 2 m r e g i s t r y s i g n a t u r e /
888- )
889- t . matchSnapshot ( joinedOutput ( ) )
890- } )
891-
892874 t . test ( 'with invalid signatures' , async t => {
893875 npm . prefix = validInstall ( )
894876 await manifestWithInvalidSigs ( )
@@ -919,20 +901,6 @@ t.test('audit signatures', async t => {
919901 t . matchSnapshot ( joinedOutput ( ) )
920902 } )
921903
922- t . test ( 'with color and both valid and missing signatures' , async t => {
923- npm . prefix = installWithMultipleDeps ( )
924- npm . color = true
925- await manifestWithValidSigs ( )
926- await manifestWithoutSigs ( 'async' , '1.1.1' )
927- validKeys ( )
928-
929- await audit . exec ( [ 'signatures' ] )
930-
931- t . equal ( process . exitCode , 1 , 'should exit with error' )
932- process . exitCode = 0
933- t . matchSnapshot ( joinedOutput ( ) )
934- } )
935-
936904 t . test ( 'with both invalid and missing signatures' , async t => {
937905 npm . prefix = installWithMultipleDeps ( )
938906 await manifestWithInvalidSigs ( )
@@ -962,20 +930,6 @@ t.test('audit signatures', async t => {
962930 t . matchSnapshot ( joinedOutput ( ) )
963931 } )
964932
965- t . test ( 'with color and multiple invalid signatures' , async t => {
966- npm . prefix = installWithMultipleDeps ( )
967- npm . color = true
968- await manifestWithInvalidSigs ( 'kms-demo' , '1.0.0' )
969- await manifestWithInvalidSigs ( 'async' , '1.1.1' )
970- validKeys ( )
971-
972- await audit . exec ( [ 'signatures' ] )
973-
974- t . equal ( process . exitCode , 1 , 'should exit with error' )
975- process . exitCode = 0
976- t . matchSnapshot ( joinedOutput ( ) )
977- } )
978-
979933 t . test ( 'with multiple missing signatures' , async t => {
980934 npm . prefix = installWithMultipleDeps ( )
981935 await manifestWithoutSigs ( 'kms-demo' , '1.0.0' )
@@ -989,20 +943,6 @@ t.test('audit signatures', async t => {
989943 t . matchSnapshot ( joinedOutput ( ) )
990944 } )
991945
992- t . test ( 'with color and multiple missing signatures' , async t => {
993- npm . prefix = installWithMultipleDeps ( )
994- npm . color = true
995- await manifestWithoutSigs ( 'kms-demo' , '1.0.0' )
996- await manifestWithoutSigs ( 'async' , '1.1.1' )
997- validKeys ( )
998-
999- await audit . exec ( [ 'signatures' ] )
1000-
1001- t . equal ( process . exitCode , 1 , 'should exit with error' )
1002- process . exitCode = 0
1003- t . matchSnapshot ( joinedOutput ( ) )
1004- } )
1005-
1006946 t . test ( 'with signatures but no public keys' , async t => {
1007947 npm . prefix = validInstall ( )
1008948 await manifestWithValidSigs ( )
@@ -1454,6 +1394,68 @@ t.test('audit signatures', async t => {
14541394 )
14551395 } )
14561396
1397+ t . test ( 'with color output enabled' , async t => {
1398+ t . test ( 'with invalid signatures' , async t => {
1399+ npm . prefix = validInstall ( )
1400+ npm . color = true
1401+ await manifestWithInvalidSigs ( )
1402+ validKeys ( )
1403+
1404+ await audit . exec ( [ 'signatures' ] )
1405+
1406+ t . equal ( process . exitCode , 1 , 'should exit with error' )
1407+ process . exitCode = 0
1408+ t . match (
1409+ joinedOutput ( ) ,
1410+ /* eslint-disable-next-line no-control-regex */
1411+ / \u001b \[ 1 m \u001b \[ 3 1 m i n v a l i d \u001b \[ 3 9 m \u001b \[ 2 2 m r e g i s t r y s i g n a t u r e /
1412+ )
1413+ t . matchSnapshot ( joinedOutput ( ) )
1414+ } )
1415+
1416+ t . test ( 'with both valid and missing signatures' , async t => {
1417+ npm . prefix = installWithMultipleDeps ( )
1418+ npm . color = true
1419+ await manifestWithValidSigs ( )
1420+ await manifestWithoutSigs ( 'async' , '1.1.1' )
1421+ validKeys ( )
1422+
1423+ await audit . exec ( [ 'signatures' ] )
1424+
1425+ t . equal ( process . exitCode , 1 , 'should exit with error' )
1426+ process . exitCode = 0
1427+ t . matchSnapshot ( joinedOutput ( ) )
1428+ } )
1429+
1430+ t . test ( 'with multiple invalid signatures' , async t => {
1431+ npm . prefix = installWithMultipleDeps ( )
1432+ npm . color = true
1433+ await manifestWithInvalidSigs ( 'kms-demo' , '1.0.0' )
1434+ await manifestWithInvalidSigs ( 'async' , '1.1.1' )
1435+ validKeys ( )
1436+
1437+ await audit . exec ( [ 'signatures' ] )
1438+
1439+ t . equal ( process . exitCode , 1 , 'should exit with error' )
1440+ process . exitCode = 0
1441+ t . matchSnapshot ( joinedOutput ( ) )
1442+ } )
1443+
1444+ t . test ( 'with multiple missing signatures' , async t => {
1445+ npm . prefix = installWithMultipleDeps ( )
1446+ npm . color = true
1447+ await manifestWithoutSigs ( 'kms-demo' , '1.0.0' )
1448+ await manifestWithoutSigs ( 'async' , '1.1.1' )
1449+ validKeys ( )
1450+
1451+ await audit . exec ( [ 'signatures' ] )
1452+
1453+ t . equal ( process . exitCode , 1 , 'should exit with error' )
1454+ process . exitCode = 0
1455+ t . matchSnapshot ( joinedOutput ( ) )
1456+ } )
1457+ } )
1458+
14571459 t . test ( 'workspaces' , async t => {
14581460 t . test ( 'verifies registry deps and ignores local workspace deps' , async t => {
14591461 npm . prefix = workspaceInstall ( )
0 commit comments