watchdog.js 806 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. import Watchdog from '../src/watchdog';
  6. describe( 'Watchdog', () => {
  7. it( 'should not be created directly', () => {
  8. expect( () => {
  9. // eslint-disable-next-line no-unused-vars
  10. const watchdog = new Watchdog( {} );
  11. } ).to.throw( /Please, use `EditorWatchdog` if you have used the `Watchdog` class previously\./ );
  12. } );
  13. it( 'should be created using the inheritance', () => {
  14. class FooWatchdog extends Watchdog {
  15. _restart() {}
  16. _isErrorComingFromThisItem() {}
  17. }
  18. expect( () => {
  19. // eslint-disable-next-line no-unused-vars
  20. const fooWatchdog = new FooWatchdog( {} );
  21. } ).to.not.throw();
  22. } );
  23. } );