Skip to content

Commit

Permalink
use built in test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed May 13, 2024
1 parent 2e7c812 commit 4615133
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"description": "Standardizes the spelling of our beloved city, Sault Ste. Marie!",
"exports": "./index.js",
"scripts": {
"test": "mocha",
"coverage": "c8 mocha"
"test": "node --test",
"coverage": "c8 node --test"
},
"keywords": [
"sault-ste-marie"
Expand All @@ -25,7 +25,6 @@
},
"homepage": "https://github.com/cityssm/is-sault-ste-marie#readme",
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.11",
"eslint-config-cityssm": "^2.1.0"
},
Expand Down
9 changes: 4 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import assert from 'node:assert';
import * as isSaultSteMarie from '../index.js';
import { describe, it } from 'node:test';
describe('spellings', () => {
before(() => {
console.log([...isSaultSteMarie.lowerCaseSaultSteMarieSpellings]);
});
it('Has spellings of Sault Ste. Marie available', () => {
assert.ok(isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size > 0);
});
Expand All @@ -16,11 +14,12 @@ describe('isSaultSteMarie()', () => {
it('Return false for spellings that are not Sault Ste. Marie', () => {
assert.ok(!isSaultSteMarie.isSaultSteMarie('Toronto'));
});
it('Accepts a new spelling of Sault Ste. Marie', () => {
it('Adds a new spelling of Sault Ste. Marie', () => {
const pizzaCaptial = 'pizza capital of ontario';
assert.ok(!isSaultSteMarie.isSaultSteMarie(pizzaCaptial));
const formerSpellingCount = isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size;
isSaultSteMarie.addSaultSteMarieSpelling(pizzaCaptial);
console.log(isSaultSteMarie.lowerCaseSaultSteMarieSpellings);
assert.strictEqual(isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size, formerSpellingCount + 1);
assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCaptial));
});
});
Expand Down
10 changes: 4 additions & 6 deletions test/test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import assert from 'node:assert'

import * as isSaultSteMarie from '../index.js'
import { before, describe, it } from 'node:test'

describe('spellings', () => {
before(() => {
console.log([...isSaultSteMarie.lowerCaseSaultSteMarieSpellings])
})

it('Has spellings of Sault Ste. Marie available', () => {
assert.ok(isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size > 0)
})
Expand All @@ -22,13 +19,14 @@ describe('isSaultSteMarie()', () => {
assert.ok(!isSaultSteMarie.isSaultSteMarie('Toronto'))
})

it('Accepts a new spelling of Sault Ste. Marie', () => {
it('Adds a new spelling of Sault Ste. Marie', () => {
const pizzaCaptial = 'pizza capital of ontario'

assert.ok(!isSaultSteMarie.isSaultSteMarie(pizzaCaptial))

const formerSpellingCount = isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size
isSaultSteMarie.addSaultSteMarieSpelling(pizzaCaptial)
console.log(isSaultSteMarie.lowerCaseSaultSteMarieSpellings)
assert.strictEqual(isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size, formerSpellingCount + 1)

assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCaptial))
})
Expand Down

0 comments on commit 4615133

Please sign in to comment.