mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
Pass with eslint --fix
Resolved whitespace issues, e.g., space-before-function-paren and key-spacing
This commit is contained in:
parent
36e4683aa8
commit
68ed110b49
21 changed files with 975 additions and 975 deletions
|
@ -26,7 +26,7 @@ test('create event', function (t) {
|
||||||
t.type(result[0].opcode, 'string');
|
t.type(result[0].opcode, 'string');
|
||||||
t.type(result[0].fields, 'object');
|
t.type(result[0].fields, 'object');
|
||||||
t.type(result[0].inputs, 'object');
|
t.type(result[0].inputs, 'object');
|
||||||
t.type(result[0].inputs['DURATION'], 'object');
|
t.type(result[0].inputs.DURATION, 'object');
|
||||||
t.type(result[0].topLevel, 'boolean');
|
t.type(result[0].topLevel, 'boolean');
|
||||||
t.equal(result[0].topLevel, true);
|
t.equal(result[0].topLevel, true);
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ test('create event', function (t) {
|
||||||
t.type(result[1].opcode, 'string');
|
t.type(result[1].opcode, 'string');
|
||||||
t.type(result[1].fields, 'object');
|
t.type(result[1].fields, 'object');
|
||||||
t.type(result[1].inputs, 'object');
|
t.type(result[1].inputs, 'object');
|
||||||
t.type(result[1].fields['NUM'], 'object');
|
t.type(result[1].fields.NUM, 'object');
|
||||||
t.type(result[1].fields['NUM'].value, '10');
|
t.type(result[1].fields.NUM.value, '10');
|
||||||
t.type(result[1].topLevel, 'boolean');
|
t.type(result[1].topLevel, 'boolean');
|
||||||
t.equal(result[1].topLevel, false);
|
t.equal(result[1].topLevel, false);
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@ test('create with branch', function (t) {
|
||||||
t.type(result[0].opcode, 'string');
|
t.type(result[0].opcode, 'string');
|
||||||
t.type(result[0].fields, 'object');
|
t.type(result[0].fields, 'object');
|
||||||
t.type(result[0].inputs, 'object');
|
t.type(result[0].inputs, 'object');
|
||||||
t.type(result[0].inputs['SUBSTACK'], 'object');
|
t.type(result[0].inputs.SUBSTACK, 'object');
|
||||||
t.type(result[0].topLevel, 'boolean');
|
t.type(result[0].topLevel, 'boolean');
|
||||||
t.equal(result[0].topLevel, true);
|
t.equal(result[0].topLevel, true);
|
||||||
// In branch
|
// In branch
|
||||||
var branchBlockId = result[0].inputs['SUBSTACK']['block'];
|
var branchBlockId = result[0].inputs.SUBSTACK.block;
|
||||||
var branchShadowId = result[0].inputs['SUBSTACK']['shadow'];
|
var branchShadowId = result[0].inputs.SUBSTACK.shadow;
|
||||||
t.type(branchBlockId, 'string');
|
t.type(branchBlockId, 'string');
|
||||||
t.equal(branchShadowId, null);
|
t.equal(branchShadowId, null);
|
||||||
// Find actual branch block
|
// Find actual branch block
|
||||||
|
@ -76,17 +76,17 @@ test('create with two branches', function (t) {
|
||||||
t.type(result[0].opcode, 'string');
|
t.type(result[0].opcode, 'string');
|
||||||
t.type(result[0].fields, 'object');
|
t.type(result[0].fields, 'object');
|
||||||
t.type(result[0].inputs, 'object');
|
t.type(result[0].inputs, 'object');
|
||||||
t.type(result[0].inputs['SUBSTACK'], 'object');
|
t.type(result[0].inputs.SUBSTACK, 'object');
|
||||||
t.type(result[0].inputs['SUBSTACK2'], 'object');
|
t.type(result[0].inputs.SUBSTACK2, 'object');
|
||||||
t.type(result[0].topLevel, 'boolean');
|
t.type(result[0].topLevel, 'boolean');
|
||||||
t.equal(result[0].topLevel, true);
|
t.equal(result[0].topLevel, true);
|
||||||
// In branchs
|
// In branchs
|
||||||
var firstBranchBlockId = result[0].inputs['SUBSTACK']['block'];
|
var firstBranchBlockId = result[0].inputs.SUBSTACK.block;
|
||||||
var secondBranchBlockId = result[0].inputs['SUBSTACK2']['block'];
|
var secondBranchBlockId = result[0].inputs.SUBSTACK2.block;
|
||||||
t.type(firstBranchBlockId, 'string');
|
t.type(firstBranchBlockId, 'string');
|
||||||
t.type(secondBranchBlockId, 'string');
|
t.type(secondBranchBlockId, 'string');
|
||||||
var firstBranchShadowBlockId = result[0].inputs['SUBSTACK']['shadow'];
|
var firstBranchShadowBlockId = result[0].inputs.SUBSTACK.shadow;
|
||||||
var secondBranchShadowBlockId = result[0].inputs['SUBSTACK2']['shadow'];
|
var secondBranchShadowBlockId = result[0].inputs.SUBSTACK2.shadow;
|
||||||
t.equal(firstBranchShadowBlockId, null);
|
t.equal(firstBranchShadowBlockId, null);
|
||||||
t.equal(secondBranchShadowBlockId, null);
|
t.equal(secondBranchShadowBlockId, null);
|
||||||
// Find actual branch blocks
|
// Find actual branch blocks
|
||||||
|
|
|
@ -245,8 +245,8 @@ test('create', function (t) {
|
||||||
topLevel: true
|
topLevel: true
|
||||||
});
|
});
|
||||||
|
|
||||||
t.type(b._blocks['foo'], 'object');
|
t.type(b._blocks.foo, 'object');
|
||||||
t.equal(b._blocks['foo'].opcode, 'TEST_BLOCK');
|
t.equal(b._blocks.foo.opcode, 'TEST_BLOCK');
|
||||||
t.notEqual(b._scripts.indexOf('foo'), -1);
|
t.notEqual(b._scripts.indexOf('foo'), -1);
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
@ -277,7 +277,7 @@ test('move', function (t) {
|
||||||
});
|
});
|
||||||
t.equal(b._scripts.length, 1);
|
t.equal(b._scripts.length, 1);
|
||||||
t.equal(Object.keys(b._blocks).length, 2);
|
t.equal(Object.keys(b._blocks).length, 2);
|
||||||
t.equal(b._blocks['foo'].next, 'bar');
|
t.equal(b._blocks.foo.next, 'bar');
|
||||||
|
|
||||||
// Detach 'bar' from 'foo'
|
// Detach 'bar' from 'foo'
|
||||||
b.moveBlock({
|
b.moveBlock({
|
||||||
|
@ -286,7 +286,7 @@ test('move', function (t) {
|
||||||
});
|
});
|
||||||
t.equal(b._scripts.length, 2);
|
t.equal(b._scripts.length, 2);
|
||||||
t.equal(Object.keys(b._blocks).length, 2);
|
t.equal(Object.keys(b._blocks).length, 2);
|
||||||
t.equal(b._blocks['foo'].next, null);
|
t.equal(b._blocks.foo.next, null);
|
||||||
|
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
@ -314,7 +314,7 @@ test('move into empty', function (t) {
|
||||||
newInput: 'fooInput',
|
newInput: 'fooInput',
|
||||||
newParent: 'foo'
|
newParent: 'foo'
|
||||||
});
|
});
|
||||||
t.equal(b._blocks['foo'].inputs['fooInput'].block, 'bar');
|
t.equal(b._blocks.foo.inputs.fooInput.block, 'bar');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -347,8 +347,8 @@ test('move no obscure shadow', function (t) {
|
||||||
newInput: 'fooInput',
|
newInput: 'fooInput',
|
||||||
newParent: 'foo'
|
newParent: 'foo'
|
||||||
});
|
});
|
||||||
t.equal(b._blocks['foo'].inputs['fooInput'].block, 'bar');
|
t.equal(b._blocks.foo.inputs.fooInput.block, 'bar');
|
||||||
t.equal(b._blocks['foo'].inputs['fooInput'].shadow, 'y');
|
t.equal(b._blocks.foo.inputs.fooInput.shadow, 'y');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ test('change', function (t) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test that the field is updated
|
// Test that the field is updated
|
||||||
t.equal(b._blocks['foo'].fields.someField.value, 'initial-value');
|
t.equal(b._blocks.foo.fields.someField.value, 'initial-value');
|
||||||
|
|
||||||
b.changeBlock({
|
b.changeBlock({
|
||||||
element: 'field',
|
element: 'field',
|
||||||
|
@ -378,7 +378,7 @@ test('change', function (t) {
|
||||||
value: 'final-value'
|
value: 'final-value'
|
||||||
});
|
});
|
||||||
|
|
||||||
t.equal(b._blocks['foo'].fields.someField.value, 'final-value');
|
t.equal(b._blocks.foo.fields.someField.value, 'final-value');
|
||||||
|
|
||||||
// Invalid cases
|
// Invalid cases
|
||||||
// No `element`
|
// No `element`
|
||||||
|
@ -387,7 +387,7 @@ test('change', function (t) {
|
||||||
name: 'someField',
|
name: 'someField',
|
||||||
value: 'invalid-value'
|
value: 'invalid-value'
|
||||||
});
|
});
|
||||||
t.equal(b._blocks['foo'].fields.someField.value, 'final-value');
|
t.equal(b._blocks.foo.fields.someField.value, 'final-value');
|
||||||
|
|
||||||
// No block ID
|
// No block ID
|
||||||
b.changeBlock({
|
b.changeBlock({
|
||||||
|
@ -395,7 +395,7 @@ test('change', function (t) {
|
||||||
name: 'someField',
|
name: 'someField',
|
||||||
value: 'invalid-value'
|
value: 'invalid-value'
|
||||||
});
|
});
|
||||||
t.equal(b._blocks['foo'].fields.someField.value, 'final-value');
|
t.equal(b._blocks.foo.fields.someField.value, 'final-value');
|
||||||
|
|
||||||
// No such field
|
// No such field
|
||||||
b.changeBlock({
|
b.changeBlock({
|
||||||
|
@ -404,7 +404,7 @@ test('change', function (t) {
|
||||||
name: 'someWrongField',
|
name: 'someWrongField',
|
||||||
value: 'final-value'
|
value: 'final-value'
|
||||||
});
|
});
|
||||||
t.equal(b._blocks['foo'].fields.someField.value, 'final-value');
|
t.equal(b._blocks.foo.fields.someField.value, 'final-value');
|
||||||
|
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
@ -423,7 +423,7 @@ test('delete', function (t) {
|
||||||
id: 'foo'
|
id: 'foo'
|
||||||
});
|
});
|
||||||
|
|
||||||
t.type(b._blocks['foo'], 'undefined');
|
t.type(b._blocks.foo, 'undefined');
|
||||||
t.equal(b._scripts.indexOf('foo'), -1);
|
t.equal(b._scripts.indexOf('foo'), -1);
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
@ -459,9 +459,9 @@ test('delete chain', function (t) {
|
||||||
b.deleteBlock({
|
b.deleteBlock({
|
||||||
id: 'foo'
|
id: 'foo'
|
||||||
});
|
});
|
||||||
t.type(b._blocks['foo'], 'undefined');
|
t.type(b._blocks.foo, 'undefined');
|
||||||
t.type(b._blocks['foo2'], 'undefined');
|
t.type(b._blocks.foo2, 'undefined');
|
||||||
t.type(b._blocks['foo3'], 'undefined');
|
t.type(b._blocks.foo3, 'undefined');
|
||||||
t.equal(b._scripts.indexOf('foo'), -1);
|
t.equal(b._scripts.indexOf('foo'), -1);
|
||||||
t.equal(Object.keys(b._blocks).length, 0);
|
t.equal(Object.keys(b._blocks).length, 0);
|
||||||
t.equal(b._scripts.length, 0);
|
t.equal(b._scripts.length, 0);
|
||||||
|
@ -532,11 +532,11 @@ test('delete inputs', function (t) {
|
||||||
b.deleteBlock({
|
b.deleteBlock({
|
||||||
id: 'foo'
|
id: 'foo'
|
||||||
});
|
});
|
||||||
t.type(b._blocks['foo'], 'undefined');
|
t.type(b._blocks.foo, 'undefined');
|
||||||
t.type(b._blocks['foo2'], 'undefined');
|
t.type(b._blocks.foo2, 'undefined');
|
||||||
t.type(b._blocks['foo3'], 'undefined');
|
t.type(b._blocks.foo3, 'undefined');
|
||||||
t.type(b._blocks['foo4'], 'undefined');
|
t.type(b._blocks.foo4, 'undefined');
|
||||||
t.type(b._blocks['foo5'], 'undefined');
|
t.type(b._blocks.foo5, 'undefined');
|
||||||
t.equal(b._scripts.indexOf('foo'), -1);
|
t.equal(b._scripts.indexOf('foo'), -1);
|
||||||
t.equal(Object.keys(b._blocks).length, 0);
|
t.equal(Object.keys(b._blocks).length, 0);
|
||||||
t.equal(b._scripts.length, 0);
|
t.equal(b._scripts.length, 0);
|
||||||
|
|
Loading…
Reference in a new issue