Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/concept/amusement-park/amusement-park.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
revokeTicket,
simpleTicketStatus,
ticketStatus,
} from './amusement-park';
} from './amusement-park.js';

describe('createVisitor', () => {
test('correctly assembles the visitor object', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
canFreePrisoner,
canSignalPrisoner,
canSpy,
} from './annalyns-infiltration';
} from './annalyns-infiltration.js';

describe('can execute fast attack', () => {
test('when the knight is awake', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
isValid,
updateAppointment,
timeBetween,
} from './appointment-time';
} from './appointment-time.js';

describe('createAppointment', () => {
test('uses the passed in current time', () => {
Expand Down
6 changes: 5 additions & 1 deletion exercises/concept/bird-watcher/bird-watcher.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { describe, expect, test } from '@jest/globals';
import { birdsInWeek, fixBirdCountLog, totalBirdCount } from './bird-watcher';
import {
birdsInWeek,
fixBirdCountLog,
totalBirdCount,
} from './bird-watcher.js';

const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom');
const customLogSymbol = Symbol.for('exercism.javascript.util.log');
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/captains-log/captains-log.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
randomShipRegistryNumber,
randomStardate,
randomPlanetClass,
} from './captains-log';
} from './captains-log.js';

describe('randomShipRegistryNumber', () => {
test('registry numbers are valid', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
memoizeTransform,
scale2d,
translate2d,
} from './coordinate-transformation';
} from './coordinate-transformation.js';

const fakeTransform = () => {
let first = true;
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/custom-signs/custom-signs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
buildSign,
costOf,
graduationFor,
} from './custom-signs';
} from './custom-signs.js';

describe('buildSign', () => {
test('occasion is Birthday', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getFirstEvenCardPosition,
getFirstOddCard,
isEachCardEven,
} from './enchantments';
} from './enchantments.js';

describe('getCardPosition', () => {
test('when it is the first card', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
shiftThreeCardsAround,
pickNamedPile,
swapNamedPile,
} from './enchantments';
} from './enchantments.js';

const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom');
const customLogSymbol = Symbol.for('exercism.javascript.util.log');
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/elyses-enchantments/enchantments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
removeItemAtBottom,
removeItemFromTop,
setItem,
} from './enchantments';
} from './enchantments.js';

describe('pick a card', () => {
test('get the first card', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals';
import { cardTypeCheck, determineOddEvenCards } from './enchantments';
import { cardTypeCheck, determineOddEvenCards } from './enchantments.js';

const TYPE_IS_ODD = false;
const TYPE_IS_EVEN = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
seeingDouble,
threeOfEachThree,
twoIsSpecial,
} from './enchantments';
} from './enchantments.js';

describe('seeingDouble', () => {
test('doubles all the values', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/factory-sensors/factory-sensors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
monitorTheMachine,
OverheatingError,
reportOverheating,
} from './factory-sensors';
} from './factory-sensors.js';

describe('checkHumidityLevel', () => {
test('should throw if the humidity percentage is 71', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
dayRate,
daysInBudget,
priceWithMonthlyDiscount,
} from './freelancer-rates';
} from './freelancer-rates.js';

const DIFFERENCE_PRECISION_IN_DIGITS = 6;

Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/fruit-picker/.meta/exemplar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// @ts-check

import { notify } from './notifier';
import { order } from './grocer';
import { notify } from './notifier.js';
import { order } from './grocer.js';

/**
* @return void
Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/fruit-picker/fruit-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//
// In your own projects, files, and code, you can play with @ts-check as well.

import { notify } from './notifier';
import { order } from './grocer';
import { notify } from './notifier.js';
import { order } from './grocer.js';

/**
* @return void
Expand Down
17 changes: 11 additions & 6 deletions exercises/concept/fruit-picker/fruit-picker.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { afterEach, describe, expect, test, jest } from '@jest/globals';
import { onError, onSuccess, orderFromGrocer, postOrder } from './fruit-picker';
import { order } from './grocer';
import { notify } from './notifier';

jest.mock('./notifier', () => ({
import {
onError,
onSuccess,
orderFromGrocer,
postOrder,
} from './fruit-picker.js';
import { order } from './grocer.js';
import { notify } from './notifier.js';

jest.mock('./notifier.js', () => ({
notify: jest.fn(),
}));

jest.mock('./grocer', () => ({
jest.mock('./grocer.js', () => ({
order: jest.fn(),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createScoreBoard,
removePlayer,
updateScore,
} from './high-score-board';
} from './high-score-board.js';

describe('createScoreBoard', () => {
test('creates a new board with a test entry', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/lasagna-master/lasagna-master.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
preparationTime,
quantities,
scaleRecipe,
} from './lasagna-master';
} from './lasagna-master.js';

const DIFFERENCE_PRECISION_IN_DIGITS = 6;

Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/lasagna/lasagna.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
preparationTimeInMinutes,
remainingMinutesInOven,
totalTimeInMinutes,
} from './lasagna';
} from './lasagna.js';

describe('EXPECTED_MINUTES_IN_OVEN', () => {
test('constant is defined correctly', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/lucky-numbers/lucky-numbers.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals';
import { errorMessage, luckyNumber, twoSum } from './lucky-numbers';
import { errorMessage, luckyNumber, twoSum } from './lucky-numbers.js';

describe('twoSum', () => {
test('sums the numbers correctly for short arrays', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/mixed-juices/mixed-juices.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals';
import { limesToCut, remainingOrders, timeToMixJuice } from './mixed-juices';
import { limesToCut, remainingOrders, timeToMixJuice } from './mixed-juices.js';

describe('timeToMixJuice', () => {
test("returns the correct time for 'Pure Strawberry Joy'", () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/nullability/nullability.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals';
import { printBadge } from './nullability';
import { printBadge } from './nullability.js';

describe('nullability', () => {
describe('printBadge', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/ozans-playlist/ozans-playlist.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
hasTrack,
listArtists,
removeDuplicates,
} from './ozans-playlist';
} from './ozans-playlist.js';

describe('removeDuplicates', () => {
test('works for an empty playlist', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/pizza-order/pizza-order.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals';
import { orderPrice, pizzaPrice } from './pizza-order';
import { orderPrice, pizzaPrice } from './pizza-order.js';

class PizzaOrder {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
backDoorResponse,
frontDoorPassword,
frontDoorResponse,
} from './door-policy';
} from './door-policy.js';

const recite = (poem, responseFn) => {
return poem.map((line) => responseFn(line));
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/recycling-robot/assembly-line.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
hasType,
hasIdProperty,
hasDefinedType,
} from './assembly-line';
} from './assembly-line.js';
import { ElectronicDevice } from './lib.js';

describe('isBoolean', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/regular-chatbot/regular-chatbot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
isValidCommand,
niceToMeetYou,
removeEmoji,
} from './regular-chatbot';
} from './regular-chatbot.js';

describe('isValidCommand', () => {
test('recognizes wheter the command is at the first position', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/train-driver/train-driver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
correctListOfWagons,
extendRouteInformation,
separateTimeOfArrival,
} from './train-driver';
} from './train-driver.js';

const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom');
const customLogSymbol = Symbol.for('exercism.javascript.util.log');
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/translation-service/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
NotAvailable,
Untranslatable,
ConnectionError,
} from './errors';
} from './errors.js';

const mutex = { current: false };

Expand Down
6 changes: 3 additions & 3 deletions exercises/concept/translation-service/service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
BatchIsEmpty,
QualityThresholdNotMet,
TranslationService,
} from './service';
} from './service.js';

import { ExternalApi } from './api';
import { ConnectionError, NotAvailable, Untranslatable } from './errors';
import { ExternalApi } from './api.js';
import { ConnectionError, NotAvailable, Untranslatable } from './errors.js';

describe('Free service', () => {
/** @type {TranslationService} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
calculateResellPrice,
chooseVehicle,
needsLicense,
} from './vehicle-purchase';
} from './vehicle-purchase.js';

describe('needsLicense', () => {
test('requires a license for a car', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ProgramWindow,
Size,
changeWindow,
} from './windowing-system';
} from './windowing-system.js';

describe('Size class', () => {
test('allows to create a new instance', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/accumulate/accumulate.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { accumulate } from './accumulate';
import { accumulate } from './accumulate.js';

describe('accumulate()', () => {
test('accumulation empty', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/acronym/acronym.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { parse } from './acronym';
import { parse } from './acronym.js';

describe('Acronyms are produced from', () => {
// basic
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/affine-cipher/affine-cipher.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { decode, encode } from './affine-cipher';
import { decode, encode } from './affine-cipher.js';

describe('Affine cipher', () => {
describe('encode', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/all-your-base/all-your-base.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { convert } from './all-your-base';
import { convert } from './all-your-base.js';

describe('Converter', () => {
test('single bit one to decimal', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/allergies/allergies.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { Allergies } from './allergies';
import { Allergies } from './allergies.js';

describe('Allergies', () => {
describe('testing for eggs allergy', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/alphametics/alphametics.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { solve } from './alphametics';
import { solve } from './alphametics.js';

describe('Solve the alphametics puzzle', () => {
test('puzzle with three letters', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/anagram/anagram.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { findAnagrams } from './anagram';
import { findAnagrams } from './anagram.js';

const areSetsEqual = (setA, setB) =>
setA.size === setB.size && [...setA].every((val) => setB.has(val));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { isArmstrongNumber } from './armstrong-numbers';
import { isArmstrongNumber } from './armstrong-numbers.js';

describe('Armstrong Numbers', () => {
test('Zero is an Armstrong number', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/atbash-cipher.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { decode, encode } from './atbash-cipher';
import { decode, encode } from './atbash-cipher.js';

describe('Atbash Cipher', () => {
describe('encode', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/bank-account/bank-account.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { BankAccount, ValueError } from './bank-account';
import { BankAccount, ValueError } from './bank-account.js';

describe('Bank Account', () => {
test('newly opened account has zero balance', () => {
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/beer-song/beer-song.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { recite } from './beer-song';
import { recite } from './beer-song.js';

describe('Beer Song', () => {
describe('verse', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, xtest } from '@jest/globals';
import { BinarySearchTree } from './binary-search-tree';
import { BinarySearchTree } from './binary-search-tree.js';

function recordAllData(bst) {
const out = [];
Expand Down
Loading