Skip to content

Commit fa7ed97

Browse files
author
gourijain026@gmail.com
committed
style: fix Prettier formatting in ExtrasBlocks and generate test files
1 parent f0ec800 commit fa7ed97

File tree

2 files changed

+41
-39
lines changed

2 files changed

+41
-39
lines changed

js/blocks/__tests__/ExtrasBlocks.test.js

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -175,45 +175,47 @@ describe("ExtrasBlocks", () => {
175175
blockNames.forEach(name => {
176176
const blockInstance = new mockBlockClass();
177177

178-
blockInstance.flow = jest
179-
.fn()
180-
.mockImplementation(function (args = [], logo = {}, turtle) {
181-
if (args.includes("test.abc")) {
182-
this.activity.save.afterSaveAbc("test.abc");
183-
}
184-
if (args.includes("test.ly")) {
185-
this.activity.save.afterSaveLilypond("test.ly");
186-
}
187-
if (args.includes("test.svg")) {
188-
this.activity.save.saveSVG("test.svg");
189-
}
190-
if (this instanceof this.activity.blocks.NoBackgroundBlock) {
191-
logo.svgBackground = false;
192-
}
193-
if (this instanceof this.activity.blocks.WaitBlock) {
194-
this.activity.turtles.ithTurtle(turtle);
195-
}
196-
if (this instanceof this.activity.blocks.ShowBlocksBlock) {
197-
this.activity.blocks.showBlocks();
198-
}
199-
if (this instanceof this.activity.blocks.HideBlocksBlock) {
200-
this.activity.blocks.hideBlocks();
201-
}
202-
if (this instanceof this.activity.blocks.CommentBlock) {
203-
this.activity.textMsg(args[0]);
204-
}
205-
if (this instanceof this.activity.blocks.PrintBlock) {
206-
this.activity.textMsg(args[0]);
207-
}
208-
if (this instanceof this.activity.blocks.DisplayGridBlock) {
209-
if (args[0] === "Cartesian") {
210-
this.activity.blocks.activity._showCartesian();
211-
} else if (args[0] === "polar") {
212-
this.activity.blocks.activity._showPolar();
213-
}
178+
blockInstance.flow = jest.fn().mockImplementation(function (
179+
args = [],
180+
logo = {},
181+
turtle
182+
) {
183+
if (args.includes("test.abc")) {
184+
this.activity.save.afterSaveAbc("test.abc");
185+
}
186+
if (args.includes("test.ly")) {
187+
this.activity.save.afterSaveLilypond("test.ly");
188+
}
189+
if (args.includes("test.svg")) {
190+
this.activity.save.saveSVG("test.svg");
191+
}
192+
if (this instanceof this.activity.blocks.NoBackgroundBlock) {
193+
logo.svgBackground = false;
194+
}
195+
if (this instanceof this.activity.blocks.WaitBlock) {
196+
this.activity.turtles.ithTurtle(turtle);
197+
}
198+
if (this instanceof this.activity.blocks.ShowBlocksBlock) {
199+
this.activity.blocks.showBlocks();
200+
}
201+
if (this instanceof this.activity.blocks.HideBlocksBlock) {
202+
this.activity.blocks.hideBlocks();
203+
}
204+
if (this instanceof this.activity.blocks.CommentBlock) {
205+
this.activity.textMsg(args[0]);
206+
}
207+
if (this instanceof this.activity.blocks.PrintBlock) {
208+
this.activity.textMsg(args[0]);
209+
}
210+
if (this instanceof this.activity.blocks.DisplayGridBlock) {
211+
if (args[0] === "Cartesian") {
212+
this.activity.blocks.activity._showCartesian();
213+
} else if (args[0] === "polar") {
214+
this.activity.blocks.activity._showPolar();
214215
}
215-
return args;
216-
});
216+
}
217+
return args;
218+
});
217219

218220
blockInstance.arg = jest.fn().mockReturnValue("parsedArg");
219221

js/js-export/__tests__/generate.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ describe("JSGenerate Class", () => {
261261
"background: greenyellow; color: midnightblue; font-weight: bold"
262262
);
263263
});
264-
264+
265265
test("should generate stack trees with various block types and arguments", () => {
266266
globalActivity.blocks.stackList = [1, 20];
267267
const booleanGrandParent = { constructor: { name: "BooleanBlock" } };

0 commit comments

Comments
 (0)