ga-wdi-boston / js-reference-types-practice

Practice with collections and functions
Other
0 stars 154 forks source link

Testing #7

Closed raq929 closed 8 years ago

raq929 commented 8 years ago

It would be helpful to know what the test is using as arguments. ie. that the test is passing "Red" to stopsBetweenStations for startLine rather than "Red Line".

Also, the test didn't test any circumstance in which the person stayed on the same line WITHOUT going through Park Street, leading me to believe my code worked when it was actually quite broken. :P

gotwilk890 commented 8 years ago

describe('Red Line', function() {

it('goes from "Alewife" to "South Station"', function() {
  expect(mbta.stopsBetweenStations('Red', 'Alewife', 'Red', 'South Station')).toBe(7);
});

it('goes from "South Station" to "Alewife"', function() {
  expect(mbta.stopsBetweenStations('Red', 'South Station', 'Red', 'Alewife')).toBe(7);
});

});

describe('Green Line', function() {

it('goes from "haymarket" to "copley"', function() {
  expect(mbta.stopsBetweenStations('Green', 'Government Center', 'Green', 'Kenmore')).toBe(6);
});

it('goes from "copley" to "haymarket"', function() {
  expect(mbta.stopsBetweenStations('Green', 'Kenmore', 'Green', 'Government Center')).toBe(6);
});

});

describe('Orange Line', function() {

it('goes from "North Station" to "Forest Hills"', function() {
  expect(mbta.stopsBetweenStations('Orange', 'North Station', 'Orange', 'Forest Hills')).toBe(7);
});

it('goes from "Forest Hills" to "North Station"', function() {
  expect(mbta.stopsBetweenStations('Orange', 'Forest Hills', 'Orange', 'North Station')).toBe(7);
});

These tests located in the test file do actually test same line travel