@schukai/monster 4.150.7 → 4.150.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +0,0 @@
1
- if (typeof window === 'object') {
2
-
3
- (function () {
4
-
5
- let sayswho = (function () {
6
- var ua = navigator.userAgent, tem,
7
- M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
8
- if (/trident/i.test(M[1])) {
9
- tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
10
- return 'IE ' + (tem[1] || '');
11
- }
12
- if (M[1] === 'Chrome') {
13
- tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
14
- if (tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
15
- }
16
- M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
17
- if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]);
18
- return M.join(' ');
19
- })();
20
-
21
-
22
- let element = document.querySelector('h1')
23
- element.innerHTML += " " + sayswho;
24
-
25
- })();
26
-
27
-
28
- }
@@ -1,134 +0,0 @@
1
- import puppeteer from 'puppeteer';
2
- import {unlinkSync} from 'fs';
3
- import {existsSync} from 'fs';
4
- import {mkdtempSync, rmSync} from 'fs';
5
- import {tmpdir} from 'os';
6
- import path from 'path';
7
-
8
-
9
- // args auswerten mit --path und --browser, get from args
10
- const args = process.argv;
11
-
12
- const config = {};
13
-
14
-
15
- for (let i = 0; i < args.length; i++) {
16
- if (args[i] === '--path') {
17
- config.path = args[i + 1];
18
- }
19
- if (args[i] === '--browser') {
20
- config.browser = args[i + 1];
21
- }
22
- }
23
-
24
- if (!config.path) {
25
- console.error('Path is required, please provide --path');
26
- process.exit(1);
27
- }
28
-
29
- if (!config.browser) {
30
- console.error('Browser is required, please provide --browser');
31
- process.exit(1);
32
- }
33
-
34
-
35
- (async () => {
36
- const userDataDir = mkdtempSync(path.join(tmpdir(), 'monster-webtest-'));
37
- let browser;
38
-
39
- try {
40
- try {
41
- browser = await puppeteer.launch({
42
- headless: 'new', // if you want to see the browser, set this to false
43
- executablePath: config.browser,
44
- //args: ['--no-sandbox',"--window-size=1440,1000", "--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu"],
45
- args: ["--disable-gpu",
46
- '--no-sandbox',
47
- '--disable-setuid-sandbox',
48
- `--user-data-dir=${userDataDir}`,
49
- '--enable-logging=stderr',
50
- '--disable-web-security',
51
- '--disable-features=IsolateOrigins',
52
- '--disable-site-isolation-trials',
53
- '--disable-crash-reporter',
54
- '--disable-breakpad',
55
- '--no-first-run',
56
- '--no-default-browser-check',
57
- '--disable-dev-shm-usage'
58
- ],
59
-
60
- userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36',
61
- waitUntil: 'load',
62
- timeout: 0,
63
- protocolTimeout: 0,
64
- dumpio: true
65
- });
66
- } catch (error) {
67
- console.error('Browser launch failed');
68
- console.error(`Browser executable: ${config.browser}`);
69
- console.error(`Browser profile: ${userDataDir}`);
70
- throw error;
71
- }
72
-
73
- const page = await browser.newPage();
74
- const fileUrl = 'file://' + config.path;
75
-
76
- console.log('Loading page... '+fileUrl);
77
-
78
- await page.goto(fileUrl, {waitUntil: 'load', timeout: 0});
79
-
80
- const title = await page.title();
81
- console.log('Page title:', title);
82
-
83
- // page.on('console', async e => {
84
- // const args = await Promise.all(e.args().map(a => a.jsonValue()));
85
- // console[e.type() === 'warning' ? 'warn' : e.type()](...args);
86
- // });
87
- //
88
- //
89
- //
90
- console.log('Running tests...');
91
- await page.waitForFunction('document.getElementById("mocha-done").textContent.length > 0',
92
- {
93
- timeout: 1000000,
94
- polling: 1000
95
- }
96
- ) ;
97
-
98
- const passes = await page.evaluate(() => document.getElementById('mocha-stats').querySelector('li.passes em').textContent);
99
- const failures = await page.evaluate(() => document.getElementById('mocha-stats').querySelector('li.failures em').textContent);
100
- const duration = await page.evaluate(() => document.getElementById('mocha-stats').querySelector('li.duration em').textContent);
101
-
102
- console.log('Tests passed:', passes);
103
- console.log('Tests failed:', failures);
104
- console.log('Duration:', duration);
105
-
106
- if (existsSync('screenshot.png')) {
107
- unlinkSync('screenshot.png');
108
- }
109
-
110
- await page.screenshot({ path: 'screenshot.png' });
111
-
112
- const failuresAsInt = parseInt(failures);
113
- if (failuresAsInt > 0) {
114
- console.error('Tests failed');
115
-
116
- await page.evaluate(() => {
117
- document.querySelectorAll('.test.fail').forEach((node) => {
118
- console.error(node.textContent);
119
- });
120
- });
121
-
122
- process.exitCode = 1;
123
- } else {
124
- console.log('Tests passed');
125
- }
126
- } finally {
127
- if (browser) {
128
- await browser.close().catch(() => {});
129
- }
130
-
131
- rmSync(userDataDir, { recursive: true, force: true });
132
- }
133
-
134
- })();
@@ -1,90 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8"/>
5
- <title>Mocha Monster</title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
- <link rel="stylesheet" href="mocha.css"/>
8
-
9
- </head>
10
- <body>
11
- <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
12
- <h1 style='margin-bottom: 0.1em;'>Monster 4.137.5</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Mon May 25 15:45:10 CEST 2026</div>
14
- </div>
15
- <div id="mocha-errors"
16
- style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
17
- <div id="mocha-done"
18
- style="color: grey;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
19
- <div id="mocks" style="position: absolute;right: 0;top: -1000px;"></div>
20
- <div id="mocha"></div>
21
- <script src="mocha.js?"></script>
22
- <script>
23
- mocha.setup('bdd');
24
- </script>
25
- <script src="tests.js?r=21:36:59"></script>
26
- <script>
27
-
28
- try {
29
- const ignoredBrowserErrorMessages = new Set([
30
- "ResizeObserver loop completed with undelivered notifications.",
31
- "ResizeObserver loop limit exceeded",
32
- ]);
33
-
34
- const isIgnoredBrowserError = (message, error) => {
35
- const normalizedMessage = typeof message === "string" && message !== ""
36
- ? message
37
- : error?.message;
38
- return ignoredBrowserErrorMessages.has(normalizedMessage);
39
- };
40
-
41
- addEventListener("error", (event) => {
42
- if (isIgnoredBrowserError(event.message, event.error)) {
43
- event.preventDefault?.();
44
- return;
45
- }
46
-
47
- document.getElementById('mocha-errors').insertAdjacentHTML("afterbegin", event.message);
48
- document.getElementById('mocha-stats').style.backgroundColor = 'red';
49
- });
50
-
51
- let runner = mocha.run((failures) => {
52
- if (failures) {
53
- document.getElementById('mocha-stats').style.backgroundColor = 'red';
54
- } else {
55
- document.getElementById('mocha-stats').style.backgroundColor = 'green';
56
- }
57
-
58
- });
59
-
60
- const mochaOnError = window.onerror;
61
- if (typeof mochaOnError === "function") {
62
- window.onerror = function(message, source, line, column, error) {
63
- if (isIgnoredBrowserError(message, error)) {
64
- return true;
65
- }
66
-
67
- return mochaOnError.call(this, message, source, line, column, error);
68
- };
69
- }
70
-
71
- runner.on('end', function () {
72
- document.getElementById('mocha-done').insertAdjacentHTML("afterbegin", 'the execution is done');
73
- document.getElementById('lastupdate').innerHTML = 'last update ' + new Date();
74
- });
75
-
76
- runner.on('fail', function () {
77
- document.querySelector('body').insertAdjacentHTML("afterbegin", '<div style="color: red;">error</div>');
78
- document.getElementById('lastupdate').innerHTML = 'last update ' + new Date();
79
- });
80
-
81
- } catch (e) {
82
- document.querySelector('body').insertAdjacentHTML("afterbegin", '<div style="color: red;">' + e + '</div>');
83
-
84
- console.error(e);
85
- document.getElementById('mocha-stats').style.backgroundColor = 'red';
86
- }
87
-
88
- </script>
89
- </body>
90
- </html>