From a5fef2f660cf96940200f0f4ad40bcf9fb790115 Mon Sep 17 00:00:00 2001 From: Carl Date: Thu, 29 Dec 2022 13:02:00 +0100 Subject: [PATCH] Runned prettier again --- .../train-driver/.docs/instructions.md | 12 +- .../train-driver/.docs/introduction.md | 20 +-- .../concept/train-driver/train-driver.js | 2 +- .../concept/train-driver/train-driver.spec.js | 138 +++++++++--------- 4 files changed, 86 insertions(+), 86 deletions(-) diff --git a/exercises/concept/train-driver/.docs/instructions.md b/exercises/concept/train-driver/.docs/instructions.md index 68146f6e48..6c466db264 100644 --- a/exercises/concept/train-driver/.docs/instructions.md +++ b/exercises/concept/train-driver/.docs/instructions.md @@ -70,8 +70,8 @@ The variable `moreRouteInformation` can contain different properties. ``` ```javascript -route = { from: "Berlin", to: "Hamburg" }; -moreRouteInformation = { length: "100", speed: "50" }; +route = { from: 'Berlin', to: 'Hamburg' }; +moreRouteInformation = { length: '100', speed: '50' }; extendRouteInformation(route, moreRouteInformation); // => {from: "Berlin", to: "Hamburg", length: "100", speed: "50"} ``` @@ -86,10 +86,10 @@ The function should return an array there the first element of the array is the ```javascript routeInformation = { - from: "Berlin", - to: "Hamburg", - length: "100", - timeOfArrival: "10:10", + from: 'Berlin', + to: 'Hamburg', + length: '100', + timeOfArrival: '10:10', }; separateTimeOfArrival(routeInformation); // => ["10:10", {from: "Berlin", to: "Hamburg", length: "100"}] diff --git a/exercises/concept/train-driver/.docs/introduction.md b/exercises/concept/train-driver/.docs/introduction.md index b8b27892a8..53dbcfa7be 100644 --- a/exercises/concept/train-driver/.docs/introduction.md +++ b/exercises/concept/train-driver/.docs/introduction.md @@ -30,9 +30,9 @@ Similarly to arrays, the rest operator can also be used to collect one or more o ```javascript const { street, ...address } = { - street: "Platz der Republik 1", - postalCode: "11011", - city: "Berlin", + street: 'Platz der Republik 1', + postalCode: '11011', + city: 'Berlin', }; street; // => 'Platz der Republik 1' @@ -46,11 +46,11 @@ When `...` appears in a function definition next to its last argument, that para ```javascript function concat(...strings) { - return strings.join(" "); + return strings.join(' '); } -concat("one"); +concat('one'); // => 'one' -concat("one", "two", "three"); +concat('one', 'two', 'three'); // => 'one two three' ``` @@ -65,7 +65,7 @@ const oneToFive = [1, 2, 3, 4, 5]; const oneToTen = [...oneToFive, 6, 7, 8, 9, 10]; oneToTen; // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -const woow = ["A", ...oneToFive, "B", "C", "D", "E", ...oneToFive, 42]; +const woow = ['A', ...oneToFive, 'B', 'C', 'D', 'E', ...oneToFive, 42]; woow; // => ["A", 1, 2, 3, 4, 5, "B", "C", "D", "E", 1, 2, 3, 4, 5, 42] ``` @@ -76,10 +76,10 @@ Similarly to arrays, the spread operator can also be used to copy properties fro ```javascript let address = { - postalCode: "11011", - city: "Berlin", + postalCode: '11011', + city: 'Berlin', }; -address = { ...address, country: "Germany" }; +address = { ...address, country: 'Germany' }; // => { // postalCode: '11011', // city: 'Berlin', diff --git a/exercises/concept/train-driver/train-driver.js b/exercises/concept/train-driver/train-driver.js index da40852ced..d7c06e9c26 100644 --- a/exercises/concept/train-driver/train-driver.js +++ b/exercises/concept/train-driver/train-driver.js @@ -54,4 +54,4 @@ export function extendRouteInformation(route, moreRouteInformation) { */ export function separateTimeOfArrival(route) { throw new Error('Please implement the separateTimeOfArrival function'); -} \ No newline at end of file +} diff --git a/exercises/concept/train-driver/train-driver.spec.js b/exercises/concept/train-driver/train-driver.spec.js index 16b4ba6f25..eaf921cd22 100644 --- a/exercises/concept/train-driver/train-driver.spec.js +++ b/exercises/concept/train-driver/train-driver.spec.js @@ -4,48 +4,48 @@ import { correctListOfWagons, extendRouteInformation, separateTimeOfArrival, -} from "./train-driver"; +} from './train-driver'; -describe("getListOfWagons", () => { - test("return the correct array", () => { +describe('getListOfWagons', () => { + test('return the correct array', () => { expect(getListOfWagons(1, 5, 2, 7, 4)).toEqual([1, 5, 2, 7, 4]); }); - test("works for a few arrgument", () => { + test('works for a few arrgument', () => { expect(getListOfWagons(1, 5)).toEqual([1, 5]); }); - test("works for a one arrgument", () => { + test('works for a one arrgument', () => { expect(getListOfWagons(1)).toEqual([1]); }); - test("works for many argument", () => { + test('works for many argument', () => { expect(getListOfWagons(1, 5, 6, 3, 9, 8, 4, 14, 24, 7)).toEqual([ 1, 5, 6, 3, 9, 8, 4, 14, 24, 7, ]); }); }); -describe("fixListOfWagons", () => { - test("reorder the first 2 wagons to the end of the array", () => { +describe('fixListOfWagons', () => { + test('reorder the first 2 wagons to the end of the array', () => { const eachWagonsID = [3, 7, 1, 14, 10, 4, 12, 6, 23, 17, 13, 20, 8, 19]; const expected = [1, 14, 10, 4, 12, 6, 23, 17, 13, 20, 8, 19, 3, 7]; expect(fixListOfWagons(eachWagonsID)).toEqual(expected); }); - test("works when only 3 wagons given", () => { + test('works when only 3 wagons given', () => { const eachWagonsID = [4, 2, 1]; expect(fixListOfWagons(eachWagonsID)).toEqual([1, 4, 2]); }); - test("works for a few wagons", () => { + test('works for a few wagons', () => { const eachWagonsID = [3, 4, 1, 5, 7, 9, 10]; expect(fixListOfWagons(eachWagonsID)).toEqual([1, 5, 7, 9, 10, 3, 4]); }); }); -describe("correctListOfWagons", () => { - test("returns a wagon wieght list with the inserted array of values", () => { +describe('correctListOfWagons', () => { + test('returns a wagon wieght list with the inserted array of values', () => { const eachWagonsID = [1, 6, 11, 15, 13, 14, 17, 22, 2, 16, 19, 21]; const missingWagons = [8, 10, 5, 9, 3, 7, 20]; const expected = [ @@ -54,14 +54,14 @@ describe("correctListOfWagons", () => { expect(correctListOfWagons(eachWagonsID, missingWagons)).toEqual(expected); }); - test("works for short arrays", () => { + test('works for short arrays', () => { const eachWagonsID = [1, 7, 15, 24]; const missingWagons = [8, 6, 4]; const expected = [1, 8, 6, 4, 7, 15, 24]; expect(correctListOfWagons(eachWagonsID, missingWagons)).toEqual(expected); }); - test("works when missingWagons is longer", () => { + test('works when missingWagons is longer', () => { const eachWagonsID = [1, 7, 15, 24]; const missingWagons = [8, 6, 4, 5, 9, 21, 2, 13]; const expected = [1, 8, 6, 4, 5, 9, 21, 2, 13, 7, 15, 24]; @@ -69,53 +69,53 @@ describe("correctListOfWagons", () => { }); }); -describe("extendRouteInformation", () => { - test("correctly extend route information", () => { - const route = { from: "Berlin", to: "Hamburg" }; +describe('extendRouteInformation', () => { + test('correctly extend route information', () => { + const route = { from: 'Berlin', to: 'Hamburg' }; const moreRouteInformation = { - timeOfArrival: "12:00", - precipitation: "10", - temperature: "5", + timeOfArrival: '12:00', + precipitation: '10', + temperature: '5', }; const expected = { - from: "Berlin", - to: "Hamburg", - timeOfArrival: "12:00", - precipitation: "10", - temperature: "5", + from: 'Berlin', + to: 'Hamburg', + timeOfArrival: '12:00', + precipitation: '10', + temperature: '5', }; expect(extendRouteInformation(route, moreRouteInformation)).toEqual( expected ); }); - test("works when not adding precipitation", () => { - const route = { from: "Paris", to: "London" }; - const moreRouteInformation = { timeOfArrival: "10:30", temperature: "20" }; + test('works when not adding precipitation', () => { + const route = { from: 'Paris', to: 'London' }; + const moreRouteInformation = { timeOfArrival: '10:30', temperature: '20' }; const expected = { - from: "Paris", - to: "London", - timeOfArrival: "10:30", - temperature: "20", + from: 'Paris', + to: 'London', + timeOfArrival: '10:30', + temperature: '20', }; expect(extendRouteInformation(route, moreRouteInformation)).toEqual( expected ); }); - test("works when written in diffrent order", () => { - const route = { from: "Gothenburg", to: "Copenhagen" }; + test('works when written in diffrent order', () => { + const route = { from: 'Gothenburg', to: 'Copenhagen' }; const moreRouteInformation = { - precipitation: "1", - timeOfArrival: "21:20", - temperature: "-6", + precipitation: '1', + timeOfArrival: '21:20', + temperature: '-6', }; const expected = { - from: "Gothenburg", - to: "Copenhagen", - precipitation: "1", - timeOfArrival: "21:20", - temperature: "-6", + from: 'Gothenburg', + to: 'Copenhagen', + precipitation: '1', + timeOfArrival: '21:20', + temperature: '-6', }; expect(extendRouteInformation(route, moreRouteInformation)).toEqual( expected @@ -123,51 +123,51 @@ describe("extendRouteInformation", () => { }); }); -describe("separateTimeOfArrival", () => { - test("seperate timeOfArrival from object", () => { +describe('separateTimeOfArrival', () => { + test('seperate timeOfArrival from object', () => { const route = { - from: "Berlin", - to: "Hamburg", - timeOfArrival: "12:00", - precipitation: "10", - temperature: "5", + from: 'Berlin', + to: 'Hamburg', + timeOfArrival: '12:00', + precipitation: '10', + temperature: '5', }; const expected = [ - "12:00", - { from: "Berlin", to: "Hamburg", precipitation: "10", temperature: "5" }, + '12:00', + { from: 'Berlin', to: 'Hamburg', precipitation: '10', temperature: '5' }, ]; expect(separateTimeOfArrival(route)).toEqual(expected); }); - test("seperate timeOfArrival with shorter object", () => { + test('seperate timeOfArrival with shorter object', () => { const route = { - from: "Paris", - to: "London", - timeOfArrival: "10:30", - temperature: "20", + from: 'Paris', + to: 'London', + timeOfArrival: '10:30', + temperature: '20', }; const expected = [ - "10:30", - { from: "Paris", to: "London", temperature: "20" }, + '10:30', + { from: 'Paris', to: 'London', temperature: '20' }, ]; expect(separateTimeOfArrival(route)).toEqual(expected); }); - test("seperate timeOfArrival from object", () => { + test('seperate timeOfArrival from object', () => { const route = { - from: "Gothenburg", - to: "Copenhagen", - precipitation: "1", - timeOfArrival: "21:20", - temperature: "-6", + from: 'Gothenburg', + to: 'Copenhagen', + precipitation: '1', + timeOfArrival: '21:20', + temperature: '-6', }; const expected = [ - "21:20", + '21:20', { - from: "Gothenburg", - to: "Copenhagen", - precipitation: "1", - temperature: "-6", + from: 'Gothenburg', + to: 'Copenhagen', + precipitation: '1', + temperature: '-6', }, ]; expect(separateTimeOfArrival(route)).toEqual(expected);