Skip to content

Commit

Permalink
remove async, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Oct 23, 2024
1 parent 9e4a7ae commit 2ad09a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
18 changes: 9 additions & 9 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ await describe('isSaultSteMarie()', async () => {
assert.ok(isSaultSteMarie.isSaultSteMarie('Sault Ste. Marie'));
assert.ok(isSaultSteMarie.isSaultSteMarie('Sault-Sainte-Marie'));
});
await it('Return false for spellings that are not Sault Ste. Marie', async () => {
await it('Return false for spellings that are not Sault Ste. Marie', () => {
assert.ok(!isSaultSteMarie.isSaultSteMarie('Toronto'));
});
await it('Adds a new spelling of Sault Ste. Marie', async () => {
const pizzaCaptial = 'pizza capital of ontario';
assert.ok(!isSaultSteMarie.isSaultSteMarie(pizzaCaptial));
await it('Adds a new spelling of Sault Ste. Marie', () => {
const pizzaCapital = 'pizza capital of ontario';
assert.ok(!isSaultSteMarie.isSaultSteMarie(pizzaCapital));
const formerSpellingCount = isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size;
isSaultSteMarie.addSaultSteMarieSpelling(pizzaCaptial);
isSaultSteMarie.addSaultSteMarieSpelling(pizzaCapital);
assert.strictEqual(isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size, formerSpellingCount + 1);
assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCaptial));
assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCapital));
});
});
await describe('fixSaultSteMarie()', async () => {
await it('Uses the preferred spelling of Sault Ste. Marie', async () => {
await it('Uses the preferred spelling of Sault Ste. Marie', () => {
assert.strictEqual(isSaultSteMarie.fixSaultSteMarie(isSaultSteMarie.canadaPostSaultSteMarieSpelling), isSaultSteMarie.preferredSaultSteMarieSpelling);
});
await it('Uses a given spelling of Sault Ste. Marie', async () => {
await it('Uses a given spelling of Sault Ste. Marie', () => {
const givenSpelling = 'the soo';
assert.strictEqual(isSaultSteMarie.fixSaultSteMarie('sault ste marie', givenSpelling), givenSpelling);
});
await it('Returns the possible spelling when not a spelling of Sault Ste. Marie', async () => {
await it('Returns the possible spelling when not a spelling of Sault Ste. Marie', () => {
const notSaultSteMarie = 'Toronto';
assert.strictEqual(isSaultSteMarie.fixSaultSteMarie(notSaultSteMarie), notSaultSteMarie);
});
Expand Down
20 changes: 11 additions & 9 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,31 @@ await describe('isSaultSteMarie()', async () => {
assert.ok(isSaultSteMarie.isSaultSteMarie('Sault-Sainte-Marie'))
})

await it('Return false for spellings that are not Sault Ste. Marie', async () => {
await it('Return false for spellings that are not Sault Ste. Marie', () => {
assert.ok(!isSaultSteMarie.isSaultSteMarie('Toronto'))
})

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

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

const formerSpellingCount =
isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size
isSaultSteMarie.addSaultSteMarieSpelling(pizzaCaptial)

isSaultSteMarie.addSaultSteMarieSpelling(pizzaCapital)

assert.strictEqual(
isSaultSteMarie.lowerCaseSaultSteMarieSpellings.size,
formerSpellingCount + 1
)

assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCaptial))
assert.ok(isSaultSteMarie.isSaultSteMarie(pizzaCapital))
})
})

await describe('fixSaultSteMarie()', async () => {
await it('Uses the preferred spelling of Sault Ste. Marie', async () => {
await it('Uses the preferred spelling of Sault Ste. Marie', () => {
assert.strictEqual(
isSaultSteMarie.fixSaultSteMarie(
isSaultSteMarie.canadaPostSaultSteMarieSpelling
Expand All @@ -46,7 +48,7 @@ await describe('fixSaultSteMarie()', async () => {
)
})

await it('Uses a given spelling of Sault Ste. Marie', async () => {
await it('Uses a given spelling of Sault Ste. Marie', () => {
const givenSpelling = 'the soo'

assert.strictEqual(
Expand All @@ -55,7 +57,7 @@ await describe('fixSaultSteMarie()', async () => {
)
})

await it('Returns the possible spelling when not a spelling of Sault Ste. Marie', async () => {
await it('Returns the possible spelling when not a spelling of Sault Ste. Marie', () => {
const notSaultSteMarie = 'Toronto'

assert.strictEqual(
Expand Down

0 comments on commit 2ad09a5

Please sign in to comment.