@@ -11,6 +11,7 @@ import {
11
11
import { parseElement , serialize } from '@cdo/apps/xml.js' ;
12
12
import { expect } from '../util/configuredChai' ;
13
13
import sinon from 'sinon' ;
14
+ import { allowConsoleWarnings } from '../util/testUtils' ;
14
15
15
16
describe ( 'block utils' , ( ) => {
16
17
describe ( 'cleanBlocks' , ( ) => {
@@ -955,6 +956,7 @@ describe('block utils', () => {
955
956
} ) ;
956
957
} ) ;
957
958
describe ( 'custom inputs' , ( ) => {
959
+ allowConsoleWarnings ( ) ;
958
960
it ( 'generates code for a statement input' , ( ) => {
959
961
createBlock ( {
960
962
func : 'runThisCallback' ,
@@ -1061,6 +1063,17 @@ describe('block utils', () => {
1061
1063
expect ( code . trim ( ) ) . to . equal (
1062
1064
'processAnotherStringValue("some input with a \\"quote\\" in it");' ) ;
1063
1065
} ) ;
1066
+ it ( 'does not throw when there are extra args' , ( ) => {
1067
+ createBlock ( {
1068
+ name : 'extraArgsTest' ,
1069
+ expression : 'extraArgsTest;' ,
1070
+ blockText : 'run this program in strict mode' ,
1071
+ args : [ { name : 'EXTRA' } ] ,
1072
+ } , '' , 'test' ) ;
1073
+ const code = generator [ 'test_extraArgsTest' ] ( ) ;
1074
+
1075
+ expect ( code . trim ( ) ) . to . equal ( 'extraArgsTest;' ) ;
1076
+ } ) ;
1064
1077
} ) ;
1065
1078
} ) ;
1066
1079
} ) ;
0 commit comments