@stone-js/starters 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/basic-react-declarative/app/Application.tsx +0 -2
- package/basic-react-declarative/package.json +7 -7
- package/basic-react-declarative/public/favicon.svg +16 -0
- package/basic-react-declarative/tests/Application.spec.ts +25 -100
- package/basic-react-imperative/app/Application.tsx +2 -17
- package/basic-react-imperative/package.json +7 -7
- package/basic-react-imperative/public/favicon.svg +16 -0
- package/basic-react-imperative/tests/Application.spec.ts +25 -86
- package/basic-service-declarative/app/Application.ts +0 -2
- package/basic-service-declarative/package.json +6 -6
- package/basic-service-declarative/tests/Application.spec.ts +20 -53
- package/basic-service-imperative/app/Application.ts +2 -14
- package/basic-service-imperative/package.json +6 -6
- package/basic-service-imperative/tests/Application.spec.ts +19 -44
- package/continuum-showcase/package.json +11 -10
- package/continuum-showcase/public/favicon.svg +16 -0
- package/continuum-showcase/stone.config.mjs +2 -2
- package/continuum-showcase/tests/application.spec.ts +30 -0
- package/full-react-declarative/app/Application.ts +0 -4
- package/full-react-declarative/package.json +12 -12
- package/full-react-declarative/public/favicon.svg +16 -0
- package/full-react-declarative/stone.config.mjs +2 -2
- package/full-react-declarative/tests/application.spec.ts +30 -0
- package/full-react-imperative/app/Application.ts +1 -3
- package/full-react-imperative/package.json +12 -12
- package/full-react-imperative/public/favicon.svg +16 -0
- package/full-react-imperative/stone.config.mjs +2 -2
- package/full-react-imperative/tests/application.spec.ts +30 -0
- package/full-service-declarative/app/Application.ts +5 -2
- package/full-service-declarative/app/configurations/AppConfiguration.ts +1 -3
- package/full-service-declarative/package.json +13 -12
- package/full-service-declarative/stone.config.mjs +2 -2
- package/full-service-declarative/tests/application.spec.ts +30 -0
- package/full-service-imperative/app/Application.ts +8 -2
- package/full-service-imperative/app/configurations/AppConfiguration.ts +1 -3
- package/full-service-imperative/package.json +13 -12
- package/full-service-imperative/stone.config.mjs +2 -2
- package/full-service-imperative/tests/application.spec.ts +30 -0
- package/package.json +1 -1
- package/standard-react-declarative/package.json +11 -10
- package/standard-react-declarative/public/favicon.svg +16 -0
- package/standard-react-declarative/tests/application.spec.ts +30 -0
- package/standard-react-imperative/package.json +11 -10
- package/standard-react-imperative/public/favicon.svg +16 -0
- package/standard-react-imperative/tests/application.spec.ts +30 -0
- package/standard-service-declarative/package.json +9 -8
- package/standard-service-declarative/tests/Application.spec.ts +22 -94
- package/standard-service-imperative/package.json +9 -8
- package/standard-service-imperative/tests/Application.spec.ts +22 -78
- package/basic-react-declarative/vitest.config.ts +0 -24
- package/basic-react-imperative/vitest.config.ts +0 -24
- package/basic-service-declarative/vitest.config.ts +0 -24
- package/basic-service-imperative/vitest.config.ts +0 -24
- package/continuum-showcase/tests/HomePage.spec.tsx +0 -41
- package/continuum-showcase/vitest.config.ts +0 -31
- package/full-react-declarative/tests/AppLayout.spec.ts +0 -51
- package/full-react-declarative/tests/HomePage.spec.ts +0 -38
- package/full-react-declarative/vitest.config.ts +0 -24
- package/full-react-imperative/tests/HomePage.spec.ts +0 -45
- package/full-react-imperative/tests/LayoutHeader.spec.ts +0 -39
- package/full-react-imperative/vitest.config.ts +0 -24
- package/full-service-declarative/tests/PostService.spec.ts +0 -56
- package/full-service-declarative/tests/WelcomeEventHandler.spec.ts +0 -54
- package/full-service-declarative/vitest.config.ts +0 -24
- package/full-service-imperative/tests/PostService.spec.ts +0 -47
- package/full-service-imperative/tests/WelcomeEventHandler.spec.ts +0 -31
- package/full-service-imperative/vitest.config.ts +0 -24
- package/standard-react-declarative/tests/WelcomePage.spec.ts +0 -71
- package/standard-react-declarative/vitest.config.ts +0 -24
- package/standard-react-imperative/tests/WelcomePage.spec.ts +0 -53
- package/standard-react-imperative/vitest.config.ts +0 -24
- package/standard-service-declarative/vitest.config.ts +0 -24
- package/standard-service-imperative/vitest.config.ts +0 -24
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '@stone-js/core'
|
|
2
|
-
import { renderToString } from 'react-dom/server'
|
|
3
|
-
import { ReactIncomingEvent } from '@stone-js/use-react'
|
|
4
|
-
import { WelcomePage } from '../app/pages/welcome/WelcomePage'
|
|
5
|
-
import { WelcomeService } from '../app/services/WelcomeService'
|
|
6
|
-
|
|
7
|
-
describe('WelcomePage', () => {
|
|
8
|
-
let page: any
|
|
9
|
-
let mockedLogger: ILogger
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
mockedLogger = {
|
|
13
|
-
info: vi.fn(),
|
|
14
|
-
} as unknown as ILogger
|
|
15
|
-
|
|
16
|
-
page = WelcomePage({ welcomeService: WelcomeService({ logger: mockedLogger }) })
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should handle incoming events', () => {
|
|
20
|
-
// Arrange
|
|
21
|
-
const expectedMessage = 'Hello World!'
|
|
22
|
-
const event = { get: () => 'World' } as unknown as ReactIncomingEvent
|
|
23
|
-
|
|
24
|
-
// Act
|
|
25
|
-
const response = page.handle(event) as { message: string }
|
|
26
|
-
|
|
27
|
-
// Assert
|
|
28
|
-
expect(response.message).toBe(expectedMessage)
|
|
29
|
-
expect(mockedLogger.info).toHaveBeenCalledWith('Welcome World')
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
it('should render the message', () => {
|
|
33
|
-
// Arrange
|
|
34
|
-
const message = 'Hello World!'
|
|
35
|
-
|
|
36
|
-
// Act
|
|
37
|
-
const response = renderToString(page.render({ data: { message } } as any))
|
|
38
|
-
|
|
39
|
-
// Assert
|
|
40
|
-
expect(response).toContain(message)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('should render the Stone.js logo', () => {
|
|
44
|
-
// Act
|
|
45
|
-
const response = renderToString(page.render({ data: { message: 'Hello World!' } } as any))
|
|
46
|
-
|
|
47
|
-
// Assert
|
|
48
|
-
expect(response).toContain('/logo.svg')
|
|
49
|
-
expect(response).toContain('alt="Stone.js"')
|
|
50
|
-
expect(response).toContain('Welcome')
|
|
51
|
-
expect(response).toContain('Stone.js')
|
|
52
|
-
})
|
|
53
|
-
})
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
include: ['./tests/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
|
8
|
-
coverage: {
|
|
9
|
-
provider: 'v8',
|
|
10
|
-
include: ['app/**/*.ts', 'app/**/*.tsx'],
|
|
11
|
-
reporter: ['text', 'html'],
|
|
12
|
-
reportsDirectory: './coverage',
|
|
13
|
-
thresholds: {
|
|
14
|
-
100: true
|
|
15
|
-
},
|
|
16
|
-
watermarks: {
|
|
17
|
-
statements: [60, 80],
|
|
18
|
-
functions: [60, 80],
|
|
19
|
-
branches: [60, 80],
|
|
20
|
-
lines: [60, 80]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
include: ['./tests/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
|
8
|
-
coverage: {
|
|
9
|
-
provider: 'v8',
|
|
10
|
-
include: ['app/**/*.ts'],
|
|
11
|
-
reporter: ['text', 'html'],
|
|
12
|
-
reportsDirectory: './coverage',
|
|
13
|
-
thresholds: {
|
|
14
|
-
100: true
|
|
15
|
-
},
|
|
16
|
-
watermarks: {
|
|
17
|
-
statements: [60, 80],
|
|
18
|
-
functions: [60, 80],
|
|
19
|
-
branches: [60, 80],
|
|
20
|
-
lines: [60, 80]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
include: ['./tests/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
|
8
|
-
coverage: {
|
|
9
|
-
provider: 'v8',
|
|
10
|
-
include: ['app/**/*.ts'],
|
|
11
|
-
reporter: ['text', 'html'],
|
|
12
|
-
reportsDirectory: './coverage',
|
|
13
|
-
thresholds: {
|
|
14
|
-
100: true
|
|
15
|
-
},
|
|
16
|
-
watermarks: {
|
|
17
|
-
statements: [60, 80],
|
|
18
|
-
functions: [60, 80],
|
|
19
|
-
branches: [60, 80],
|
|
20
|
-
lines: [60, 80]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
}
|
|
24
|
-
});
|