suite(`class`, () => { test(`should be defined when instantiated with an empty Object`, async () => { // Conditions const fakeHistoryEntity = new fakeHistory({}); // Assertions expect(fakeHistoryEntity). and.not.to.be.undefined(). and.to.be.instanceof(fakeHistory); }); });
suite('A suite', () => { test("contains spec with an expectation", (done) => { expect(shallow(<Foo />).contains(<div className="foo" />)).to.equal(true); done(); }); test("contains spec with an expectation", (done) => { expect(shallow(<Foo />).is('.foo')).to.equal(true); done(); }); test("contains spec with an expectation", (done) => { expect(mount(<Foo />).find('.foo').length).to.equal(1); done(); }); });
suite(`interface`, () => { suite(`timezoneApi`, () => { test(`should have a defined interface to be implemented`, async () => { // Assertions expect(FakeDefaultTimezoneApiInterface). and.not.to.be.undefined(); }); test(`should have the "getTimezone()" method defined`, async () => { // Conditions const fakeTimezoneApiInterface = new FakeDefaultTimezoneApiInterface(); // Assertions expect(fakeTimezoneApiInterface). and.not.to.be.undefined(). and.to.be.an.instanceof(FakeDefaultTimezoneApiInterface); expect(fakeTimezoneApiInterface.getTimezone). and.not.to.be.undefined(). and.to.be.a.function(); }); }); });
suite(`static private method "_toTimezone()"`, () => { test(`should be defined`, async () => { // Conditions const fakeDefaultTimezoneApi = new FakeTimezoneApi(fakeConstructorParams); const fakeResponse = FakeTimezoneApi[_toTimezone](fakeToTimezoneParams); // Assertions expect(fakeDefaultTimezoneApi). and.not.to.be.undefined(). and.to.be.instanceof(FakeTimezoneApi); expect(fakeResponse). and.to.not.be.undefined(). and.to.be.an.object(). and.to.contain([ "timezone", ], ); expect(fakeResponse.timezone). and.not.to.be.undefined(). and.to.be.a.string(). and.to.equal("fakeTimezoneId"); }); });
suite(`interface`, () => { suite(`geocoderApi`, () => { test(`should have a defined interface to be implemented`, async () => { // Assertions expect(FakeDefaultGeocoderApiInterface). and.not.to.be.undefined(); }); test(`should have the "getCoordinates()" method defined`, async () => { // Conditions const fakeGeocoderApiInterface = new FakeDefaultGeocoderApiInterface(); // Assertions expect(fakeGeocoderApiInterface.getCoordinates). and.not.to.be.undefined(). and.to.be.a.function(); }); }); });
suite(`class`, () => { test(`should be defined when instantiated`, async () => { // Conditions const fakeTimezoneGateway = new FakeDefaultTimezoneGateway(fakeConstructorParams); // Assertions expect(fakeTimezoneGateway). and.not.to.be.undefined(). and.to.be.instanceof(FakeDefaultTimezoneGateway); }); test(`interface being implemented should be defined`, async () => { // Conditions const fakeTimezoneGatewayInterface = new FakeDefaultTimezoneGatewayInterface(); // Assertions expect(fakeTimezoneGatewayInterface). and.not.to.be.undefined(); }); });
suite(`static private method "_composeWeatherApiParams()"`, () => { test(`should be defined`, async () => { // Conditions const fakeDefaultWeatherApi = new FakeWeatherApi(fakeConstructorParams); const fakeResponse = FakeWeatherApi[_composeWeatherApiParams](fakeWeatherApiParams); // Assertions expect(fakeDefaultWeatherApi). and.not.to.be.undefined(). and.to.be.instanceof(FakeWeatherApi); expect(fakeResponse). and.to.not.be.undefined(). and.to.be.a.string(). and.to.equal("42,42,42"); }); });
suite(`interface`, () => { suite(`weatherApi`, () => { test(`should have a defined interface to be implemented`, async () => { // Assertions expect(FakeDefaultWeatherApiInterface). and.not.to.be.undefined(); }); test(`should have the "getWeather()" method defined`, async () => { // Conditions const fakeWeatherApiInterface = new FakeDefaultWeatherApiInterface(); // Assertions expect(fakeWeatherApiInterface). and.not.to.be.undefined(). and.to.be.an.instanceof(FakeDefaultWeatherApiInterface); expect(fakeWeatherApiInterface.getWeather). and.not.to.be.undefined(). and.to.be.a.function(); }); }); });
suite(`class`, () => { test(`should be defined when instantiated`, async () => { // Conditions const fakeGeocoderGateway = new FakeDefaultGeocoderGateway(fakeConstructorParams); // Assertions expect(fakeGeocoderGateway). and.not.to.be.undefined(). and.to.be.instanceof(FakeDefaultGeocoderGateway); }); test(`interface being implemented should be defined`, async () => { // Conditions const fakeGeocoderGatewayInterface = new FakeDefaultGeocoderGatewayInterface(); // Assertions expect(fakeGeocoderGatewayInterface). and.not.to.be.undefined(); }); });
suite(`class`, () => { test(`should be defined when instantiated with an empty Object`, async () => { // Conditions const fakeAddressEntity = new fakeAddress({}); // Assertions expect(fakeAddressEntity). and.not.to.be.undefined(). and.to.be.instanceof(fakeAddress); }); });
suite(`class`, () => { test(`should be defined when instantiated`, async () => { // Conditions const fakeWeatherGateway = new FakeDefaultWeatherGateway(fakeConstructorParams); // Assertions expect(fakeWeatherGateway). and.not.to.be.undefined(). and.to.be.instanceof(FakeDefaultWeatherGateway); }); test(`interface being implemented should be defined`, async () => { // Conditions const fakeWeatherGatewayInterface = new FakeDefaultWeatherGatewayInterface(); // Assertions expect(fakeWeatherGatewayInterface). and.not.to.be.undefined(); }); });
suite(`class`, () => { test(`should be defined when instantiated with an empty Object`, async () => { // Conditions const fakeCoordinatesEntity = new fakeCoordinates({}); // Assertions expect(fakeCoordinatesEntity). and.not.to.be.undefined(). and.to.be.instanceof(fakeCoordinates); }); });
suite(`class`, () => { test(`should be defined when instantiated with an empty Object`, async () => { // Conditions const fakeWeatherEntity = new fakeWeather({}); // Assertions expect(fakeWeatherEntity). and.not.to.be.undefined(). and.to.be.instanceof(fakeWeather); }); });
suite(`class`, () => { test(`should be defined when instantiated with all injected dependencies`, async () => { // Conditions const fakeAddressWeatherHistoryInteractor = new FakeDefaultAddressWeatherHistoryInteractor(fakeConstructorParams); // Assertions expect(fakeAddressWeatherHistoryInteractor). and.not.to.be.undefined(). and.to.be.instanceof(FakeDefaultAddressWeatherHistoryInteractor); }); });
suite(`interface`, () => { suite(`WeatherApiInterface`, () => { test(`should be defined`, async () => { // Assertions expect(FakeDefaultWeatherApiInterface). and.not.to.be.undefined(); }); test(`should have the "getWeather()" public method`, async () => { // Conditions const fakeDefaultWeatherApiInterface = new FakeDefaultWeatherApiInterface(); // Assertions expect(fakeDefaultWeatherApiInterface). and.not.to.be.undefined(). and.to.be.an.instanceof(FakeDefaultWeatherApiInterface); expect(fakeDefaultWeatherApiInterface.getWeather). and.not.to.be.undefined(). and.to.be.a.function(); }); }); });