mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat: add Nuxt.version
This commit is contained in:
parent
b9268df91b
commit
06ae3868fe
@ -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
|
||||
|
@ -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({})
|
||||
|
Loading…
Reference in New Issue
Block a user