• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-vue / 333

pending completion
333

push

travis-ci-com

pomek
Internal: Bumped the year.

19 of 19 branches covered (100.0%)

Branch coverage included in aggregate %.

46 of 46 relevant lines covered (100.0%)

18.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/plugin.js
1
/**
2
 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
/* eslint-env browser */
7
import * as Vue from 'vue';
8
import CKEditorComponent from './ckeditor.js';
9

10
const [ major ] = getVueVersion().split( '.' ).map( i => parseInt( i, 10 ) );
3✔
11

12
/* istanbul ignore if */
13
if ( major < 3 ) {
1✔
14
        throw new Error(
15
                'The CKEditor plugin works only with Vue 3+. ' +
16
                'For more information, please refer to ' +
17
                'https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html'
18
        );
19
}
20

21
const CKEditor = {
1✔
22
        /**
23
         * Installs the plugin, registering the `<ckeditor>` component.
24
         *
25
         * @param {Vue} app The application instance.
26
         */
27
        install( app ) {
28
                app.component( 'ckeditor', CKEditorComponent );
1✔
29
        },
30
        component: CKEditorComponent
31
};
32

33
export default CKEditor;
34

35
/* istanbul ignore next */
36
function getVueVersion() {
37
        // Vue 3+.
38
        if ( Vue.version ) {
39
                return Vue.version;
40
        }
41

42
        // Webpack complains if the `Vue.default` does not exist. It is exported by Vue 2.
43
        // export 'default' (imported as 'Vue') was not found in 'vue'
44
        const DEFAULT_KEY = 'default';
45

46
        if ( Vue[ DEFAULT_KEY ] ) {
47
                return Vue[ DEFAULT_KEY ].version;
48
        }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc