Skip to content

Commit

Permalink
test: drop jest-esm-transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Dec 28, 2021
1 parent 765453e commit c42789e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 42 deletions.
6 changes: 2 additions & 4 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"testEnvironment": "node",
"transform": {
"\\.m?jsx?$": "jest-esm-transformer"
},
"transform": {},
"transformIgnorePatterns": [
"/!node_modules\\/lodash-es/",
"<roodDir>/node_modules/(?!lodash-es)"
Expand All @@ -15,7 +13,7 @@
"testTimeout": 10000,
"testMatch": [
"<rootDir>/src/test/js/**/*.js",
"<rootDir>/src/test/ts/**/*.ts"
"<rootDir>/src/test/ts/**/*.mjs"
],
"testPathIgnorePatterns": [
"/node_modules/",
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "module",
"scripts": {
"test": "npm-run-all -p -l lint test:unit",
"test:unit": "yarn jest",
"test:unit": "NODE_OPTIONS=--experimental-vm-modules yarn jest",
"lint": "eslint src/{main,test}/**/*.js",
"lint:fix": "yarn lint --fix",
"format": "prettier --write \"src/**/*.js\"",
Expand All @@ -30,17 +30,15 @@
"eslint-config-qiwi": "^1.15.3",
"finalhandler": "^1.1.2",
"jest": "^27.4.5",
"jest-esm-transformer": "^1.0.0",
"jsdoc": "^3.6.7",
"prettier": "^2.5.1",
"prettier-config-qiwi": "^1.5.0",
"serve-static": "^1.14.2",
"terser": "^5.10.0",
"typescript": "*"
"terser": "^5.10.0"
},
"engines": {
"node": ">=12.12",
"npm": ">=5.6"
"node": ">=14",
"npm": ">=6"
},
"dependencies": {
"@11ty/eleventy": "^0.12.1",
Expand Down
8 changes: 4 additions & 4 deletions src/main/js/generateStatic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Eleventy from '@11ty/eleventy'
import fs from 'fs'
import fsExtra from 'fs-extra'
import { uniq } from 'lodash-es'
import path, {dirname} from 'path'
import path, { dirname } from 'path'
import { fileURLToPath } from 'url'

import {
defNavFooter,
Expand All @@ -14,7 +15,6 @@ import {
import { genMdAssets } from './generateMdAssets.js'
import { sortContextsByDate, writeSettings } from './util.js'
import { validate } from './validator.js'
import { fileURLToPath } from 'url'

const __dirname = dirname(fileURLToPath(import.meta.url))

Expand Down Expand Up @@ -113,7 +113,7 @@ export const genNavigationPage = (

// Main nav page
fsExtra.copySync(tplNavPage, output)
const tplHtml = fs.readFileSync(path.join(output, 'index.html'), 'utf8')
const tplHtml = fs.readFileSync(path.join(output, 'index.html'), 'utf8') // eslint-disable-line sonarjs/no-duplicate-string
const html = tplHtml
.replace('#nav_page-content', contentPage.join('\n'))
.replace('#nav_page-title', navTitle)
Expand All @@ -130,7 +130,7 @@ export const genNavigationPage = (
m[scope] = date
}
return m
}, {})).map(([scope, date]) => {
}, {})).forEach(([scope, date]) => {
fs.writeFileSync(path.join(output, scope, 'index.html'), redirect.replace('###', date))
})
}
2 changes: 1 addition & 1 deletion src/main/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const server = http.createServer(function onRequest (req, res) {

// Listen
server.listen(3000)
console.log('http://localhost:3000/tech-radar')
console.log('http://localhost:3000/')
File renamed without changes.
File renamed without changes.
29 changes: 2 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.5.tgz#8ef4c18e58e801c5c95d3c1c0f2874a2680fadea"
integrity sha512-kixrYn4JwfAVPa0f2yfzc2AWti6WRRyO3XjWW5PJAvtE11qhSayrrcrEnee05KAtNaPC+EwehE8Qt1UedEVB8w==

"@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.4.4", "@babel/core@^7.7.2", "@babel/core@^7.7.5":
"@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.7.2", "@babel/core@^7.7.5":
version "7.14.6"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab"
integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA==
Expand Down Expand Up @@ -327,16 +327,6 @@
dependencies:
"@babel/helper-plugin-utils" "^7.14.5"

"@babel/plugin-transform-modules-commonjs@^7.4.4":
version "7.14.5"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97"
integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A==
dependencies:
"@babel/helper-module-transforms" "^7.14.5"
"@babel/helper-plugin-utils" "^7.14.5"
"@babel/helper-simple-access" "^7.14.5"
babel-plugin-dynamic-import-node "^2.3.3"

"@babel/template@^7.14.5", "@babel/template@^7.3.3":
version "7.14.5"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4"
Expand Down Expand Up @@ -1131,13 +1121,6 @@ babel-jest@^27.4.5:
graceful-fs "^4.2.4"
slash "^3.0.0"

babel-plugin-dynamic-import-node@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3"
integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==
dependencies:
object.assign "^4.1.0"

babel-plugin-istanbul@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765"
Expand Down Expand Up @@ -3484,14 +3467,6 @@ jest-environment-node@^27.4.4:
jest-mock "^27.4.2"
jest-util "^27.4.2"

jest-esm-transformer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/jest-esm-transformer/-/jest-esm-transformer-1.0.0.tgz#b6c58f496aa48194f96361a52f5c578fd2209726"
integrity sha512-FoPgeMMwy1/CEsc8tBI41i83CEO3x85RJuZi5iAMmWoARXhfgk6Jd7y+4d+z+HCkTKNVDvSWKGRhwjzU9PUbrw==
dependencies:
"@babel/core" "^7.4.4"
"@babel/plugin-transform-modules-commonjs" "^7.4.4"

jest-get-type@^27.4.0:
version "27.4.0"
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5"
Expand Down Expand Up @@ -4426,7 +4401,7 @@ object-keys@^1.0.12, object-keys@^1.1.1:
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==

object.assign@^4.1.0, object.assign@^4.1.2:
object.assign@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
Expand Down

0 comments on commit c42789e

Please sign in to comment.