Skip to content

Instantly share code, notes, and snippets.

@petrkoula
Created September 16, 2014 08:52
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 petrkoula/74882ebd0a650959ae43 to your computer and use it in GitHub Desktop.
Save petrkoula/74882ebd0a650959ae43 to your computer and use it in GitHub Desktop.
Jasmine Spec Runner v2.0.0 Jasmine + moment // source http://jsbin.com/fekis/2
<!DOCTYPE HTML>
<html>
<head>
<meta name="description" content="Jasmine + moment" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jasmine Spec Runner v2.0.0</title>
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.css">
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine-html.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/boot.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
describe('testing toThrowError', function () {
describe('with a normal string', function () {
it('accepts the error', function () {
expect(function () {
throw new Error('foo');
}).toThrowError('foo');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format()).toBe('2014-09-16T10:44:14+02:00');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format('HH.mm ss')).toBe('10.44 14');
});
});
});
</script>
<script id="jsbin-source-html" type="text/html">
<!DOCTYPE HTML>
<html>
<head>
<meta name="description" content="Jasmine + moment" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jasmine Spec Runner v2.0.0</title>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.js"><\/script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine-html.js"><\/script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/boot.js"><\/script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"><\/script>
</head>
<body>
</body>
</html>
</script>
<script id="jsbin-source-javascript" type="text/javascript"> describe('testing toThrowError', function () {
describe('with a normal string', function () {
it('accepts the error', function () {
expect(function () {
throw new Error('foo');
}).toThrowError('foo');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format()).toBe('2014-09-16T10:44:14+02:00');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format('HH.mm ss')).toBe('10.44 14');
});
});
});</script></body>
</html>
describe('testing toThrowError', function () {
describe('with a normal string', function () {
it('accepts the error', function () {
expect(function () {
throw new Error('foo');
}).toThrowError('foo');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format()).toBe('2014-09-16T10:44:14+02:00');
});
});
describe('creates a date', function () {
it('accepts the error', function () {
expect(moment('2014-09-16T10:44:14+02:00').format('HH.mm ss')).toBe('10.44 14');
});
});
});
@petrkoula
Copy link
Author

Runs at jsbin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment