mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +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)
|
this._ready = this.ready().catch(this.errorHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get version() {
|
||||||
|
return '__VERSION__'
|
||||||
|
}
|
||||||
|
|
||||||
async ready() {
|
async ready() {
|
||||||
if (this._ready) {
|
if (this._ready) {
|
||||||
return this._ready
|
return this._ready
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import { resolve } from 'path'
|
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 => {
|
test('modulesDir uses /node_modules as default if not set', async t => {
|
||||||
const options = Options.from({})
|
const options = Options.from({})
|
||||||
|
Loading…
Reference in New Issue
Block a user