Files
panic-server/spec/framework/Test.spec.js
Jesse Gibson fe0f9aabf5 Restrict access to bump, begin client framework. All tests passing.
There were some race conditions involving the `bump` function, where some tests were failing because synchronous code was not acting as synchronous as it should (and I'm still not quite sure what's causing it). I've removed access to the bump function in the Test constructor (side note: none of the tests broke when I did, so apparently there was no coverage).

The client logic has been revised, as some of it was untested and wouldn't be useful for quite some time. I'm be starting with the context parser, then I'll be moving onto platform/ID filtering, then onto test runners/client context instances.
2016-03-03 18:25:33 -07:00

46 lines
1.1 KiB
JavaScript

/*global jasmine, describe, it, expect*/
/*jslint node: true*/
'use strict';
// should import test
var test = require('../../lib');
var Context = require('../../lib/framework/Context');
describe('The test function', function () {
it('should be a function', function () {
expect(global.test).toEqual(jasmine.any(Function));
expect(test).toEqual(jasmine.any(Function));
});
it('should take a function and invoke it', function (done) {
test(done);
});
it('should invoke with a new test context', function () {
test(function () {
expect(this).toEqual(jasmine.any(Context));
});
});
it('should allow you to name tests', function (done) {
test('Named test', done);
});
it('should pass the context as arg0', function () {
test(function (ctx) {
expect(ctx).toEqual(jasmine.any(Context));
});
});
it('should name tests without a name "Anonymous"', function () {
var result = test(function () {});
expect(result.description).toBe('Anonymous');
});
it('should remember the test name', function () {
var result = test('fabulous success', function () {});
expect(result.description).toBe('fabulous success');
});
});