Skip to content

Commit

Permalink
chore(refactor): move GimmeNumber to new structure and update test file
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsjhu committed Nov 16, 2019
1 parent da803d2 commit 4f2d5a3
Show file tree
Hide file tree
Showing 36 changed files with 197 additions and 5,299 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/
tests/
**/dist/
__tests__/
20 changes: 0 additions & 20 deletions .npmignore

This file was deleted.

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

44 changes: 0 additions & 44 deletions __tests__/error.test.js

This file was deleted.

58 changes: 11 additions & 47 deletions __tests__/error.test.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,13 @@
import test from 'ava';
import GimmeError from '../packages/error/src';

test('foo', (t: any) => {
const error = new GimmeError('uh oh');
t.is(error.message, 'uh oh');
import GimmeError from '../packages/GimmeError';

// @todo: throwing a TypeError
test.skip(`throws a GimmeError error`, (t: any) => {
const fn = () => {
throw new GimmeError('uh oh!');
};
const error = t.throws(() => {
fn();
});
t.is(error.name, 'uh oh!');
});

// describe('GimmeError', function() {
// context('When a new instance is created', function() {
// const error = new GimmeError();
// const name = 'GimmeError';
// it(`should have ${name} as its name`, function() {
// expect(error.name).to.equal(
// name,
// `The name of the GimmeError instance should be ${name}. But instead it was ${
// error.name
// }`
// );
// });
// it('should extend from the Error class', function() {
// expect(error).to.be.an.instanceof(
// Error,
// `The GimmeError instance should inherit from the Error class. Instead, it is an instance of ${Object.getPrototypeOf(
// error
// )}`
// );
// });
// it('should have a default error message', function() {
// expect(error.message).to.match(/There was an error!/i);
// });

// describe('with a custom message', function() {
// const customMessage = 'with a custom message!';
// const error = new GimmeError(customMessage);

// it("should capture the message in the instance's message property", function() {
// expect(error.message).to.equal(customMessage);
// });
// });
// });
// describe('when an instance of GimmeError is thrown', function() {
// it('should return an error of type GimmeError', function() {
// expect(function() {
// throw new GimmeError();
// }).to.throw(GimmeError);
// });
// });
// });
82 changes: 0 additions & 82 deletions __tests__/number.test.js

This file was deleted.

Loading

0 comments on commit 4f2d5a3

Please sign in to comment.