diff --git a/lib/core/nuxt.js b/lib/core/nuxt.js index 072f0f665a..f9a8f00f29 100644 --- a/lib/core/nuxt.js +++ b/lib/core/nuxt.js @@ -44,6 +44,10 @@ export default class Nuxt { this._ready = this.ready().catch(this.errorHandler) } + static get version() { + return '__VERSION__' + } + async ready() { if (this._ready) { return this._ready diff --git a/test/basic.config.defaults.test.js b/test/basic.config.defaults.test.js index e0a14ed0a8..d23ad57a1f 100644 --- a/test/basic.config.defaults.test.js +++ b/test/basic.config.defaults.test.js @@ -1,6 +1,11 @@ import test from 'ava' import { resolve } from 'path' -import { Options } from '../index' +import { Nuxt, Options } from '../index' +import { version } from '../package.json' + +test('Nuxt.version is same as package', t => { + t.is(Nuxt.version, version) +}) test('modulesDir uses /node_modules as default if not set', async t => { const options = Options.from({})