From e21c1b31928cd6bfe90150ea2de19799b6359c40 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 23 Mar 2022 16:20:39 -0300 Subject: splitted rollup config for testing and first component state unit test --- .../rollup.config.test.js | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 packages/taler-wallet-webextension/rollup.config.test.js (limited to 'packages/taler-wallet-webextension/rollup.config.test.js') diff --git a/packages/taler-wallet-webextension/rollup.config.test.js b/packages/taler-wallet-webextension/rollup.config.test.js new file mode 100644 index 000000000..387e176bb --- /dev/null +++ b/packages/taler-wallet-webextension/rollup.config.test.js @@ -0,0 +1,47 @@ +// rollup.config.js +import fs from 'fs'; +import path from 'path'; +import css from 'rollup-plugin-css-only'; +import { makePlugins } from "./rollup.config" + +function fromDir(startPath, regex) { + if (!fs.existsSync(startPath)) { + return; + } + const files = fs.readdirSync(startPath); + const result = files.flatMap(file => { + const filename = path.join(startPath, file); + + const stat = fs.lstatSync(filename); + if (stat.isDirectory()) { + return fromDir(filename, regex); + } + else if (regex.test(filename)) { + return filename + } + }).filter(x => !!x) + + return result +} + +const tests = fromDir('./src', /.test.ts$/) + .filter(t => t === 'src/wallet/CreateManualWithdraw.test.ts') + .map(test => ({ + input: test, + output: { + file: test.replace(/^src/, 'dist').replace(/\.ts$/, '.js'), + format: "iife", + exports: "none", + name: test, + }, + plugins: [ + ...makePlugins(), + css({ + output: 'walletEntryPoint.css', + }), + ], + })) + +export default [ + ...tests, +]; -- cgit v1.2.3