mardi 26 janvier 2016

Is this an example of "testing someone else's code"

I'm new to testing, and I understand it's not a good practice to write unit tests that test third-party packages. But I'm curious if the following test would constitute testing the AngularJS framework:

describe("TestController", function () {
    it("should set up the $scope correctly", function () {
        expect($scope.foo).toBe("bar");
    });
});

Is it a good idea to test that your $scope got initialized correctly, or since that's AngularJS's job and not yours, is that something you should avoid writing a test for? Sorry if this has an obvious answer, but I want to make sure I'm teaching correct principles when I teach this to my students.

Aucun commentaire:

Enregistrer un commentaire