<commit_before>import test from 'tape';
import jsdom from 'jsdom';

import {
  square,
  circle,
  diamond
} from '../src/shapes.js';

global.document = jsdom.jsdom('<html></html>');
global.window = global.document.defaultView;

test('square returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testSquare = square(10);

  t.equal(testSquare instanceof window.HTMLCanvasElement, true);
  t.equal(testSquare.width, 10);
});

test('circle returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testCircle = circle(10);

  t.equal(testCircle instanceof window.HTMLCanvasElement, true);
  t.equal(testCircle.width, 10);
});

test('diamond returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testDiamond = diamond(10);

  t.equal(testDiamond instanceof window.HTMLCanvasElement, true);
  t.equal(testDiamond.width, 10);
});<commit_msg>Refactored shape tests, window object isn't actually needed<commit_after>import test from 'tape';
import jsdom from 'jsdom';

import {
  square,
  circle,
  diamond
} from '../src/shapes.js';

global.document = jsdom.jsdom('<html></html>');

test('square returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testSquare = square(10);

  t.equal(testSquare.toString(), '[object HTMLCanvasElement]');
  t.equal(testSquare.width, 10);
});

test('circle returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testCircle = circle(10);

  t.equal(testCircle.toString(), '[object HTMLCanvasElement]');
  t.equal(testCircle.width, 10);
});

test('diamond returns a canvas element of specified width and height', (t) => {
  t.plan(2);

  let testDiamond = diamond(10);

  t.equal(testDiamond.toString(), '[object HTMLCanvasElement]');
  t.equal(testDiamond.width, 10);
});
{'fraction_non_alphanumeric': 0.15372168284789645, 'fraction_numerical': 0.016181229773462782, 'mean_word_length': 4.707692307692308, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1494173', 'n_tokens_mistral': 640, 'n_tokens_neox': 598, 'n_words': 164}