From 3ea39841c8049525e31e9f4d6300f0c60cdb42de Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 24 Jan 2023 13:33:51 +0100 Subject: Adding upstream version 5.2.3+dfsg. Signed-off-by: Daniel Baumann --- js/tests/integration/bundle-modularity.js | 7 +++ js/tests/integration/bundle.js | 6 +++ js/tests/integration/index.html | 67 ++++++++++++++++++++++++ js/tests/integration/rollup.bundle-modularity.js | 17 ++++++ js/tests/integration/rollup.bundle.js | 24 +++++++++ 5 files changed, 121 insertions(+) create mode 100644 js/tests/integration/bundle-modularity.js create mode 100644 js/tests/integration/bundle.js create mode 100644 js/tests/integration/index.html create mode 100644 js/tests/integration/rollup.bundle-modularity.js create mode 100644 js/tests/integration/rollup.bundle.js (limited to 'js/tests/integration') diff --git a/js/tests/integration/bundle-modularity.js b/js/tests/integration/bundle-modularity.js new file mode 100644 index 0000000..8546141 --- /dev/null +++ b/js/tests/integration/bundle-modularity.js @@ -0,0 +1,7 @@ +import Tooltip from '../../dist/tooltip' +import '../../dist/carousel' + +window.addEventListener('load', () => { + [].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]')) + .map(tooltipNode => new Tooltip(tooltipNode)) +}) diff --git a/js/tests/integration/bundle.js b/js/tests/integration/bundle.js new file mode 100644 index 0000000..452088a --- /dev/null +++ b/js/tests/integration/bundle.js @@ -0,0 +1,6 @@ +import { Tooltip } from '../../../dist/js/bootstrap.esm.js' + +window.addEventListener('load', () => { + [].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]')) + .map(tooltipNode => new Tooltip(tooltipNode)) +}) diff --git a/js/tests/integration/index.html b/js/tests/integration/index.html new file mode 100644 index 0000000..4c71bad --- /dev/null +++ b/js/tests/integration/index.html @@ -0,0 +1,67 @@ + + + + + + + + + + + Hello, world! + + +
+

Hello, world!

+ +
+ + + +
+
+ + + + diff --git a/js/tests/integration/rollup.bundle-modularity.js b/js/tests/integration/rollup.bundle-modularity.js new file mode 100644 index 0000000..a8670ca --- /dev/null +++ b/js/tests/integration/rollup.bundle-modularity.js @@ -0,0 +1,17 @@ +/* eslint-env node */ + +const commonjs = require('@rollup/plugin-commonjs') +const configRollup = require('./rollup.bundle') + +const config = { + ...configRollup, + input: 'js/tests/integration/bundle-modularity.js', + output: { + file: 'js/coverage/bundle-modularity.js', + format: 'iife' + } +} + +config.plugins.unshift(commonjs()) + +module.exports = config diff --git a/js/tests/integration/rollup.bundle.js b/js/tests/integration/rollup.bundle.js new file mode 100644 index 0000000..caddcab --- /dev/null +++ b/js/tests/integration/rollup.bundle.js @@ -0,0 +1,24 @@ +/* eslint-env node */ + +const { babel } = require('@rollup/plugin-babel') +const { nodeResolve } = require('@rollup/plugin-node-resolve') +const replace = require('@rollup/plugin-replace') + +module.exports = { + input: 'js/tests/integration/bundle.js', + output: { + file: 'js/coverage/bundle.js', + format: 'iife' + }, + plugins: [ + replace({ + 'process.env.NODE_ENV': '"production"', + preventAssignment: true + }), + nodeResolve(), + babel({ + exclude: 'node_modules/**', + babelHelpers: 'bundled' + }) + ] +} -- cgit v1.2.3