Skip to content

Instantly share code, notes, and snippets.

@lewiscowper
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewiscowper/5358cbfb79a1984c39f0 to your computer and use it in GitHub Desktop.
Save lewiscowper/5358cbfb79a1984c39f0 to your computer and use it in GitHub Desktop.
describe('on load', function () {
describe('the foo variable', function () {
it('should be defined', function () {
expect(_scope.foo).toBeDefined();
});
it('should be set correctly', function () {
expect(_scope.foo).toBe(false);
});
});
describe('the bar variable', function () {
it('should be defined', function () {
expect(_scope.bar).toBeDefined();
});
it('should be set correctly', function () {
expect(_scope.bar).toBe(true);
});
});
describe('the qux function', function () {
it('should be defined', function () {
expect(_scope.qux).toBeDefined();
});
it('should be of type function', function () {
expect(typeof _scope.qux).toBe('function');
});
it('should return the correct value', function () {
expect(_scope.qux()).toBe(false);
});
});
describe('the baz object', function () {
it('should be defined', function () {
expect(_scope.baz).toBeDefined();
});
it('should be of type object', function () {
expect(typeof _scope.baz).toBe('object');
});
it('should have a fred property', function () {
expect(_scope.baz.hasOwnProperty('fred')).toBe(true);
});
describe('the fred property', function () {
it('should be set correctly', function () {
expect(_scope.baz.fred).toEqual(3);
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment