diff options
author | Sebastian <sebasjm@gmail.com> | 2022-03-23 16:20:39 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-03-23 16:20:39 -0300 |
commit | e21c1b31928cd6bfe90150ea2de19799b6359c40 (patch) | |
tree | 10558ee2b86d5ac01de0995bfe12bdb7da44edde /packages/taler-wallet-webextension/rollup.config.test.js | |
parent | 136c39ba9fb86080beaa27cd9e0c4d5086a2d691 (diff) | |
download | wallet-core-e21c1b31928cd6bfe90150ea2de19799b6359c40.tar.xz |
splitted rollup config for testing and first component state unit test
Diffstat (limited to 'packages/taler-wallet-webextension/rollup.config.test.js')
-rw-r--r-- | packages/taler-wallet-webextension/rollup.config.test.js | 47 |
1 files changed, 47 insertions, 0 deletions
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, +]; |