// const myExtension = require('../extension'); suite('Extension Test Suite', () => { vscode.window.showInformationMessage('Start all tests.'); test('Sample test', () => { assert.equal(-1, [1, 2, 3].indexOf(5)); assert.equal(-1, [1, 2, 3].indexOf(0)); }); });
suite('p5.prototype.concat', function() { var concat = p5.prototype.concat; suite('concat()', function() { test('should concat empty arrays', function() { result = concat([], []); assert.deepEqual(result, []); }); test('should concat arrays', function() { result = concat([1], [2, 3]); assert.deepEqual(result, [1, 2, 3]); }); }); });
suite('p5.prototype.color("hsb(h, s%, b%)")', function() { setup(function() { c = myp5.color('hsb(336, 100%, 100%)'); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGBA property', function() { assert.deepEqual(c.levels, [255, 0, 102, 255]); }); });
suite('setup() after preload() without success callback', function () { test('Resource should be loaded now if preload() finished', function (done) { assert.isTrue(myFont instanceof p5.Font); assert.isObject(myFont); assert.isObject(myFont.font); done(); }); });
suite('p5.Color in HSL mode with grayscale value', function() { setup(function() { myp5.colorMode(myp5.HSL); c = myp5.color(39.3); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGB levels', function() { assert.deepEqual(c.levels, [100, 100, 100, 255]); }); });
suite('new p5(sketch, true)', function () { var myp5 = new p5(function() { }, true); var isDrawingContextDefined = myp5.drawingContext !== undefined; test('should define drawContext synchronously', function () { assert.ok(isDrawingContextDefined); }); });
suite('new p5(sketch, null, false)', function () { var myp5 = new p5(function() { }, null, false); var isDrawingContextDefined = myp5.drawingContext !== undefined; test('should define drawContext asynchronously', function () { assert.equal(isDrawingContextDefined, false); assert.isDefined(myp5.drawingContext); }); });
suite('p5.Color in RGB mode with grayscale value and alpha', function() { setup(function() { myp5.colorMode(myp5.RGB); c = myp5.color(100, 70); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGB levels', function() { assert.deepEqual(c.levels, [100, 100, 100, 70]); }); });
suite('p5.prototype.color("hsba(h, s%, b%, a)")', function() { setup(function() { c = myp5.color('hsba(336, 100%, 100%, 0.8)'); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGBA property', function() { assert.deepEqual(c.levels, [255, 0, 102, 204]); }); });
suite('p5.prototype.color([])', function() { setup(function() { c = myp5.color([255, 0, 102]); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGBA property', function() { assert.deepEqual(c.levels, [255, 0, 102, 255]); }); });
suite('p5.Color in HSL mode with grayscale value and alpha', function() { setup(function() { myp5.colorMode(myp5.HSL); c = myp5.color(39.3, 0.275); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGB levels', function() { assert.deepEqual(c.levels, [100, 100, 100, 70]); }); });
suite('new p5(sketch, node, true)', function () { var myp5 = new p5(function() { }, node, true); var isDrawingContextDefined = myp5.drawingContext !== undefined; test('should define drawContext synchronously', function () { assert.ok(isDrawingContextDefined); }); });
suite('new p5(sketch)', function () { var myp5 = new p5(function() { }); var isDrawingContextDefined = myp5.drawingContext !== undefined; test('should define drawContext asynchronously', function () { assert.equal(isDrawingContextDefined, false); assert.isDefined(myp5.drawingContext); }); });
suite('p5.prototype.color("hsl(h, s%, l%)")', function() { setup(function() { c = myp5.color('hsl(336, 100%, 50%)'); }); test('should create instance of p5.Color', function() { assert.instanceOf(c, p5.Color); }); test('should correctly set RGBA property', function() { assert.deepEqual(c.levels, [255, 0, 102, 255]); }); });