2 |
3 | {{ JSON.stringify($storage.state) }}
4 |
5 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "moduleResolution": "Node",
5 | "esModuleInterop": true,
6 | "resolveJsonModule": true,
7 | "types": [
8 | "@types/node"
9 | ]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_size = 2
6 | indent_style = space
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/test/module.test.js:
--------------------------------------------------------------------------------
1 | import { setupTest, get } from '@nuxt/test-utils'
2 |
3 | describe('My test', () => {
4 | setupTest({
5 | configFile: 'nuxt.config.ts',
6 | server: true
7 | })
8 |
9 | it('renders state', async () => {
10 | const { body } = await get('/')
11 |
12 | expect(body).toContain('{"works":true}')
13 | })
14 | })
15 |
--------------------------------------------------------------------------------
/test/fixture/nuxt.config.ts:
--------------------------------------------------------------------------------
1 | import type { NuxtConfig } from '@nuxt/types'
2 | import storageModule from '../../src/module'
3 |
4 | export default