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
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ We find that when students complete the same test suite over and over, memorizat
Completing all of these test suites is not necessary, but you should be working on this repo regularly. We see that students are the most successful when they establish a routine for working through these test suites. For example, you might work on them for 45 minutes every morning before class. Find a routine that works best for you and plan ahead so you remain on track to complete the majority of the tests.

### Test Suites
- [ ] 🧚 ‍[Mythical Creatures](./mythical-creatures)
- [ ] ✈️ [Airport](./airport)
- [ ] 🎧 [DJ](./dj)
- [ ] 🍔 [Favorite Foods](./favorite-foods)
- [ ] 🎮 [Video Games](./video-games/)
- [ ] 🎂 [Birthdays](./birthdays)
- [ ] 🗓 [Calendar](./calendar/)
- [x] 🧚 ‍[Mythical Creatures](./mythical-creatures) - DONE
- [x] 🎂 [Birthdays](./birthdays) - DONE
- [x] 🗓 [Calendar](./calendar/) - DONE
- [x] 🎮 [Video Games](./video-games/) - DONE
- [x] 🌮 [Taco Stand](./tacoStand/) - DONE
- [x] 🥗 [Meal Planning](./meal-planning/) - DONE
- [x] 🛗 [Elevator](./elevator/) - DONE
- [x] 🎵 [Spotify](./spotify/) - DONE
- [x] 🧖‍♀️ [Spa](./spa/) - DONE
- [ ] ✂️ [Barber Shop](./barber-shop/)
- [ ] 💵 [Vending Machine](./vending-machine/)
- [ ] 🛗 [Elevator](./elevator/)
- [ ] 📼 [VHS](./vhs/)
- [ ] 🎧 [DJ](./dj)
- [x] 🍔 [Favorite Foods](./favorite-foods) - DONE
- [ ] 📚 [Library](./library)
- [ ] 🌮 [Taco Stand](./tacoStand/)
- [ ] 🧶 [Crafting](./crafting/)
- [ ] ✂️ [Barber Shop](./barber-shop/)
- [ ] 🥗 [Meal Planning](./meal-planning/)
- [x] 🧶 [Crafting](./crafting/) - DONE
- [ ] 🍜 [Restaurant](./restaurant/)
- [ ] 🧖‍♀️ [Spa](./spa/)
- [ ] 🎵 [Spotify](./spotify/)
- [ ] 📼 [VHS](./vhs/)
- [x] ✈️ [Airport](./airport) - DONE

- [x] Want to track your progress? First, make sure you're on a forked version of this repo. Then, you can edit the README and change `[ ]` to `[x]` on the suites you've completed!

Expand Down
10 changes: 5 additions & 5 deletions airport/airport-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ var assert = require('chai').assert;
var { createAirport, welcomeGuests, landPlanes, checkAirlineLocations } = require('./airport');

describe('Airport', function() {
it.skip('should create an airport', function() {
it('should create an airport', function() {
var airport = createAirport('Denver International Airport', ['United', 'Southwest', 'Delta'], 144);

assert.equal(airport.name, 'Denver International Airport');
assert.equal(airport.availableGates, 144);
assert.equal(airport.airlines[0], 'United');
});

it.skip('should welcome people to the airport', function() {
it('should welcome people to the airport', function() {
var denverAirport = createAirport('Denver International Airport', ['United', 'Southwest', 'Delta'], 144);
var sanDiegoAirport = createAirport('San Diego International Airport', ['Frontier', 'American'], 48);

Expand All @@ -22,7 +22,7 @@ describe('Airport', function() {
assert.equal(sanDiegoWelcome, 'Welcome to San Diego International Airport!');
});

it.skip('should keep track of open gates', function() {
it('should keep track of open gates', function() {
var bakersfieldAirport = createAirport('Meadows Field Airport', ['United', 'American'], 12);
var sanDiegoAirport = createAirport('San Diego International Airport', ['Frontier', 'American'], 48);

Expand All @@ -33,7 +33,7 @@ describe('Airport', function() {
assert.equal(sanDiegoGates.availableGates, 46);
});

it.skip('should not be able to occupy more gates than available', function() {
it('should not be able to occupy more gates than available', function() {
var columbusAiport = createAirport('John Glenn Airport', ['Southwest', 'Frontier'], 24);

var updatedAirportGates = landPlanes(columbusAiport, 22);
Expand All @@ -47,7 +47,7 @@ describe('Airport', function() {
assert.equal(updatedAirportGates2.message, 'Oh no! Not enough gates available. Current overflow is 1.')
});

it.skip('should be able to tell you where an airline flies to', function() {
it('should be able to tell you where an airline flies to', function() {
var columbusAiport = createAirport('John Glenn Airport', ['Southwest', 'Frontier'], 24);
var bakersfieldAirport = createAirport('Meadows Field Airport', ['United', 'American'], 12);
var sanDiegoAirport = createAirport('San Diego International Airport', ['Frontier', 'American'], 48);
Expand Down
42 changes: 38 additions & 4 deletions airport/airport.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
function createAirport(name1, airlines1, availableGates1) {
var airport1 = {
name: name1,
airlines: airlines1,
availableGates: availableGates1
}
return airport1
};

function welcomeGuests(airport) {
return `Welcome to ${airport.name}!`
};

function landPlanes(airport, usedGates) {
var overflow = usedGates - airport.availableGates
airport.availableGates -= usedGates
if(airport.availableGates < 0) {
airport.message = `Oh no! Not enough gates available. Current overflow is ${overflow}.`
airport.availableGates = 0
} else {
airport.message = `Success! Current availability is ${airport.availableGates}.`
}
return airport
};

function checkAirlineLocations(airports, airline) {
var airportNames = [];
for(var i = 0; i < airports.length; i++) {
for (var z = 0; z < airports[i].airlines.length; z++) {
if(airports[i].airlines[z] === airline) {
airportNames.push(airports[i].name)
}
}
}
return airportNames
};

module.exports = {
// createAirport,
// welcomeGuests,
// landPlanes,
// checkAirlineLocations
createAirport,
welcomeGuests,
landPlanes,
checkAirlineLocations
};
8 changes: 4 additions & 4 deletions birthdays/birthdays-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var assert = require('chai').assert;
var { createBirthday, celebrateBirthday, countBirthdays } = require('./birthdays');

describe('Birthdays', function() {
it.skip('should create birthdays', function() {
it('should create birthdays', function() {
var leahBirthday = createBirthday('Leah', 2, 10);
var christyBirthday = createBirthday('Christy', 3, 8);

Expand All @@ -15,7 +15,7 @@ describe('Birthdays', function() {
assert.deepEqual(christyBirthday.day, 8);
});

it.skip('should celebrate birthdays', function() {
it('should celebrate birthdays', function() {
var alexBirthday = createBirthday('Alex', 5, 19);

var celebrateAlex = celebrateBirthday(alexBirthday);
Expand All @@ -29,13 +29,13 @@ describe('Birthdays', function() {
assert.equal(celebrateHeather, 'Today is 6/29! Happy birthday, Heather!');
})

it.skip('should count how many birthdays are in a given month', function() {
it('should count how many birthdays are in a given month', function() {
var leahBirthday = createBirthday('Leah', 2, 10);
var christyBirthday = createBirthday('Christy', 3, 8);
var alexBirthday = createBirthday('Alex', 5, 19);
var noahBirthday = createBirthday('Noah', 2, 16);
var birthdays = [leahBirthday, christyBirthday, alexBirthday, noahBirthday];

console.log('birthdays:', birthdays)
var febCount = countBirthdays(birthdays, 2);
var mayCount = countBirthdays(birthdays, 5);
var decCount = countBirthdays(birthdays, 12);
Expand Down
27 changes: 26 additions & 1 deletion birthdays/birthdays.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
function createBirthday(name, month, day) {
var birthday = {
name: name,
month: month,
day: day
}
return birthday;
};

function celebrateBirthday(birthday) {
return `Today is ${birthday.month}/${birthday.day}! Happy birthday, ${birthday.name}!`;
};

module.exports = { };
function countBirthdays(people, month) {
var birthdayCount = 0;
for(var i = 0; i < people.length; i++) {
if(people[i].month === month) {
birthdayCount ++
}
}
return birthdayCount;
};

module.exports = {
createBirthday,
celebrateBirthday,
countBirthdays
};
8 changes: 4 additions & 4 deletions calendar/calendar-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var { createEvent, createCalendar, reportMonthlyEvents } = require('./calendar')

describe('Calendar', function () {

it.skip('should create an event', function () {
it('should create an event', function () {
var event = createEvent("Go to the Park", "August", 25);

assert.equal(event.title, "Go to the Park");
Expand All @@ -18,15 +18,15 @@ describe('Calendar', function () {
assert.equal(event2.day, 1);
});

it.skip('should return an error if an invalid day is passed in', function () {
it('should return an error if an invalid day is passed in', function () {
var event1 = createEvent("Go to the Park", "August", 35);
assert.equal(event1, "Error: 35 is not a valid day");

var event2 = createEvent("Go to the Park", "August", 0);
assert.equal(event2, "Error: 0 is not a valid day");
});

it.skip('should create a calendar with events', function () {
it('should create a calendar with events', function () {
var event1 = createEvent("Go to the Park", "August", 25);
var event2 = createEvent("Dinner with Lucy", "September", 10);
var events = [event1, event2];
Expand All @@ -43,7 +43,7 @@ describe('Calendar', function () {
assert.deepEqual(calendar2.events, [event1, event2]);
});

it.skip('should gather events from the same month', function () {
it('should gather events from the same month', function () {
var event1 = createEvent("Go to the Park", "August", 25);
var event2 = createEvent("Dinner with Lucy", "July", 10);
var event3 = createEvent("Order More Batteries", "July", 2);
Expand Down
34 changes: 33 additions & 1 deletion calendar/calendar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
function createEvent(title1, month1, day1) {
var agenda = {
title: title1,
month: month1,
day: day1
}
if(agenda.day < 1 || agenda.day > 31){
return `Error: ${agenda.day} is not a valid day`
}
return agenda
};

function createCalendar(name, events1) {
var calendar1 = {
owner: name,
events: events1
}
return calendar1
};

module.exports = { };
function reportMonthlyEvents(calendar1, month) {
var monthlyEvents1 = [];
for(var i = 0; i < calendar1.events.length; i++) {
if (calendar1.events[i].month === month) {
monthlyEvents1.push(calendar1.events[i])
}
}
return monthlyEvents1
};

module.exports = {
createEvent,
createCalendar,
reportMonthlyEvents
};
20 changes: 10 additions & 10 deletions crafting/crafts-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ var { createMaterial, calculateMaterialCost, createSupplyCloset, addSupply, crea
describe('Crafting', function() {

describe('Material', function() {
it.skip('should create a new material', function() {
it('should create a new material', function() {
var yarn = createMaterial('yarn', 'skein', 6.99);

assert.equal(yarn.name, 'yarn');
assert.equal(yarn.unit, 'skein');
assert.equal(yarn.costPerUnit, 6.99);
});

it.skip('should calculate cost of material', function() {
it('should calculate cost of material', function() {
var fabric = createMaterial('fabric', 'yard', 12.50);

var fabricCost = calculateMaterialCost(fabric, 4);
Expand All @@ -28,7 +28,7 @@ describe('Crafting', function() {
});

describe('Supply Closet', function() {
it.skip('should create a supply closet', function() {
it('should create a supply closet', function() {
var fabric = createMaterial('fabric', 'yard', 12.50);
var paint = createMaterial('paint', 'pint', 3.95);
var yarn = createMaterial('yarn', 'skein', 6.99);
Expand All @@ -38,13 +38,13 @@ describe('Crafting', function() {
assert.deepEqual(myCloset, { supplies: ['fabric', 'paint', 'yarn'] });
});

it.skip('should be able to start empty', function() {
it('should be able to start empty', function() {
var myCloset = createSupplyCloset();

assert.deepEqual(myCloset, { supplies: [] });
});

it.skip('should be able to add new supplies to the supply closet', function() {
it('should be able to add new supplies to the supply closet', function() {
var glitter = createMaterial('glitter', 'ounce', .99);

var myCloset = createSupplyCloset([glitter]);
Expand All @@ -56,7 +56,7 @@ describe('Crafting', function() {
assert.deepEqual(updatedCloset, ['glitter', 'thread']);
});

it.skip('should not allow you to add the same supply again', function() {
it('should not allow you to add the same supply again', function() {
var fabric = createMaterial('fabric', 'yard', 12.50);
var paint = createMaterial('paint', 'pint', 3.95);

Expand All @@ -67,7 +67,7 @@ describe('Crafting', function() {
});

describe('Project', function() {
it.skip('should create a new craft project', function() {
it('should create a new craft project', function() {
var thread = createMaterial('thread', 'bobbin', 3.67);
var fabric = createMaterial('aida fabric', 'yard', 15.50);
var materials = [thread, fabric];
Expand All @@ -78,14 +78,14 @@ describe('Crafting', function() {
assert.equal(crossStitchProject.status, 'in progress');
});

it.skip('should have a status of not started if not specified', function() {
it('should have a status of not started if not specified', function() {
var string = createMaterial('warp string', 'yard', .49);
var yarn = createMaterial('yarn', 'skein', 7.85);

assert.equal(createNewProject([string, yarn]).status, 'not started');
});

it.skip('should be able to see if you have the necessary supplies to start a project', function() {
it('should be able to see if you have the necessary supplies to start a project', function() {
var paper = createMaterial('paper', 'ream', 13.99);
var paint = createMaterial('paint', 'bottle', '4.50');

Expand All @@ -100,7 +100,7 @@ describe('Crafting', function() {
assert.equal(check, 'Yay! You can start this project!');
});

it.skip('should be able to see if you have the necessary supplies to start a project', function() {
it('should be able to see if you have the necessary supplies to start a project', function() {
var string = createMaterial('warp string', 'yard', .49);
var yarn = createMaterial('yarn', 'skein', 7.85);

Expand Down
Loading