mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
* [next] WIP: Add basic integrations tests * fix typos in README.md * Update README.md to specify when files are _ files ignored --------- Co-authored-by: Fabio Pliger <fpliger@users.noreply.github.com>
20 lines
693 B
JavaScript
20 lines
693 B
JavaScript
const { existsSync, readdirSync } = require('node:fs');
|
|
const { join } = require('node:path');
|
|
const playwright = require('@playwright/test');
|
|
|
|
// integration tests for interpreters
|
|
const TEST_INTERPRETER = join(__dirname, 'integration');
|
|
|
|
// source of truth for interpreters
|
|
const CORE_INTERPRETER = join(__dirname, '..', 'esm', 'interpreter');
|
|
|
|
for (const file of readdirSync(TEST_INTERPRETER)) {
|
|
// filter only JS files that match their counter-part interpreter
|
|
if (/\.js$/.test(file) && existsSync(join(CORE_INTERPRETER, file))) {
|
|
require(join(TEST_INTERPRETER, file))(
|
|
playwright,
|
|
`http://localhost:8080/test/integration/interpreter/${file.slice(0, -3)}`
|
|
);
|
|
}
|
|
}
|