From 0d1a5e0ffcf689e6e6b2aaa4a4251db74f6b487b Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Apr 2021 12:41:57 +0200 Subject: Add frontend testing, require node 12 (#15315) - Add basic frontend unit testing infrastructure using jest in ESM mode - Rename 'make test' to 'make test-backend' - Introduce 'make test-frontend' and 'make test' that runs both - Bump Node.js requirement to v12. v10 will be EOL in less than a month. - Convert all build-related JS files to ESM. I opted to run frontend tests run as part of the compliance pipeline because they complete fast and are not platform-specific like the golang tests. --- build/generate-images.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'build/generate-images.js') diff --git a/build/generate-images.js b/build/generate-images.js index bea36321e3..d82f21564f 100755 --- a/build/generate-images.js +++ b/build/generate-images.js @@ -1,12 +1,11 @@ -#!/usr/bin/env node -'use strict'; - -const imageminZopfli = require('imagemin-zopfli'); -const {optimize, extendDefaultPlugins} = require('svgo'); -const {fabric} = require('fabric'); -const {readFile, writeFile} = require('fs').promises; -const {resolve} = require('path'); +import imageminZopfli from 'imagemin-zopfli'; +import {optimize, extendDefaultPlugins} from 'svgo'; +import {fabric} from 'fabric'; +import {readFile, writeFile} from 'fs/promises'; +import {resolve, dirname} from 'path'; +import {fileURLToPath} from 'url'; +const __dirname = dirname(fileURLToPath(import.meta.url)); const logoFile = resolve(__dirname, '../assets/logo.svg'); function exit(err) { -- cgit v1.2.3