Skip to content

Commit 5de5e5e

Browse files
committed
get tests running
We had to pin the `colors` library (used by live-server)because the author wilfully broke it to disrupt millions of users. Marak/colors.js#285
1 parent badcf91 commit 5de5e5e

File tree

11 files changed

+10636
-15225
lines changed

11 files changed

+10636
-15225
lines changed

Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ WORKDIR /app
33
COPY . .
44
RUN rm package-lock.json
55
RUN npm install
6-
RUN npx playwright install
6+
RUN npx playwright install
7+
8+
RUN npm install jsdom --no-save
9+
RUN rm -rf node_modules/jest-environment-jsdom/node_modules/jsdom/
10+
RUN mv node_modules/jsdom node_modules/jest-environment-jsdom/node_modules/jsdom
11+
712
RUN npm run build
813
ENTRYPOINT ["npm", "run"]
9-
CMD ["test"]
14+
CMD ["test"]

babel.config.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
module.exports = {
22
presets: [
3-
[
4-
'@babel/preset-env',
5-
{
6-
targets: {
7-
node: 'current',
8-
},
9-
},
10-
],
3+
['babel-preset-solid', { generate: 'dom', hydratable: true }],
4+
['@babel/preset-env', { targets: { node: 'current' } }],
115
],
126
};

build/ssr.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
var rollup = require('rollup')
22
var babel = require('@rollup/plugin-babel').default
3-
var async = require('rollup-plugin-async')
43
var replace = require('@rollup/plugin-replace')
54

65
rollup
76
.rollup({
87
input: 'packages/docsify-server-renderer/index.js',
98
plugins: [
10-
async(),
119
replace({
1210
__VERSION__: process.env.VERSION || require('../package.json').version,
1311
'process.env.SSR': true

jest.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
// Unit Tests (Jest)
2121
{
2222
...sharedConfig,
23+
preset: 'solid-jest/preset/browser',
2324
displayName: 'unit',
2425
setupFilesAfterEnv: ['<rootDir>/test/config/jest.setup-tests.js'],
2526
testMatch: ['<rootDir>/test/unit/*.test.js'],
@@ -28,6 +29,7 @@ module.exports = {
2829
// Integration Tests (Jest)
2930
{
3031
...sharedConfig,
32+
preset: 'solid-jest/preset/browser',
3133
displayName: 'integration',
3234
setupFilesAfterEnv: ['<rootDir>/test/config/jest.setup-tests.js'],
3335
testMatch: ['<rootDir>/test/integration/*.test.js'],

0 commit comments

Comments
 (0)