mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 15:39:39 -04:00
Add tests for converting extension metadata
These tests convert some extension metadata into scratch-blocks JSON and XML, then verify that the JSON and XML are as expected.
This commit is contained in:
parent
8ef4aec7fa
commit
53b5ba93f5
5 changed files with 206 additions and 35 deletions
src/engine
|
@ -5,10 +5,11 @@ const escapeHtml = require('escape-html');
|
|||
const ArgumentType = require('../extension-support/argument-type');
|
||||
const Blocks = require('./blocks');
|
||||
const BlockType = require('../extension-support/block-type');
|
||||
const Profiler = require('./profiler');
|
||||
const Sequencer = require('./sequencer');
|
||||
const ScratchBlocksConstants = require('./scratch-blocks-constants');
|
||||
const TargetType = require('../extension-support/target-type');
|
||||
const Thread = require('./thread');
|
||||
const Profiler = require('./profiler');
|
||||
const log = require('../util/log');
|
||||
const maybeFormatMessage = require('../util/maybe-format-message');
|
||||
|
||||
|
@ -68,32 +69,6 @@ const ConvertedSeparator = {
|
|||
xml: '<sep gap="36"/>'
|
||||
};
|
||||
|
||||
/**
|
||||
* These constants are copied from scratch-blocks/core/constants.js
|
||||
* @TODO find a way to require() these... maybe make a scratch-blocks/dist/constants.js or something like that?
|
||||
* @readonly
|
||||
* @enum {int}
|
||||
*/
|
||||
const ScratchBlocksConstants = {
|
||||
/**
|
||||
* ENUM for output shape: hexagonal (booleans/predicates).
|
||||
* @const
|
||||
*/
|
||||
OUTPUT_SHAPE_HEXAGONAL: 1,
|
||||
|
||||
/**
|
||||
* ENUM for output shape: rounded (numbers).
|
||||
* @const
|
||||
*/
|
||||
OUTPUT_SHAPE_ROUND: 2,
|
||||
|
||||
/**
|
||||
* ENUM for output shape: squared (any/all values; strings).
|
||||
* @const
|
||||
*/
|
||||
OUTPUT_SHAPE_SQUARE: 3
|
||||
};
|
||||
|
||||
/**
|
||||
* Numeric ID for Runtime._step in Profiler instances.
|
||||
* @type {number}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue