aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/ngdocSpec.js
diff options
context:
space:
mode:
authorVojta Jina2011-05-18 11:13:46 +0200
committerIgor Minar2011-06-06 22:51:59 -0700
commit8cb84eac6821f6c14f68936df1d7a6765ae96af5 (patch)
tree84942e5a2b3c8a7447278fcb8b5ef6f0dceac4bb /docs/spec/ngdocSpec.js
parent2e0e732cadd86846b57b7b02b3303a2e0e3b842a (diff)
downloadangular.js-8cb84eac6821f6c14f68936df1d7a6765ae96af5.tar.bz2
Log warning for every non existing link instead of throwing exception
Guess we don't want to stop doc generating process because of non-existing link, so just log warning and continue...
Diffstat (limited to 'docs/spec/ngdocSpec.js')
-rw-r--r--docs/spec/ngdocSpec.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index e8b8959d..52b2ce03 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -208,31 +208,26 @@ describe('ngdoc', function(){
describe('links checking', function() {
var docs;
beforeEach(function() {
+ spyOn(console, 'log');
docs = [new Doc({section: 'api', id: 'fake.id1', links: ['non-existing-link']}),
new Doc({section: 'api', id: 'fake.id2'}),
new Doc({section: 'api', id: 'fake.id3'})];
});
- it('should throw exception when any link doesn\'t exist', function() {
- expect(function() {
- ngdoc.merge(docs);
- }).toThrow();
+ it('should log warning when any link doesn\'t exist', function() {
+ ngdoc.merge(docs);
+ expect(console.log).toHaveBeenCalled();
+ expect(console.log.argsForCall[0][0]).toContain('WARNING:');
});
it('should say which link doesn\'t exist', function() {
- try {
- ngdoc.merge(docs);
- } catch (e) {
- expect(e).toContain('non-existing-link');
- }
+ ngdoc.merge(docs);
+ expect(console.log.argsForCall[0][0]).toContain('non-existing-link');
});
it('should say where is the non-existing link', function() {
- try {
- ngdoc.merge(docs);
- } catch (e) {
- expect(e).toContain('api/fake.id1');
- }
+ ngdoc.merge(docs);
+ expect(console.log.argsForCall[0][0]).toContain('api/fake.id1');
});
});
});