mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
Tests platform check
This commit is contained in:
@@ -3,7 +3,8 @@ const fs = require('fs');
|
||||
|
||||
function read(dir, createTestCase, skipTests = []) {
|
||||
function append(dir, prefix) {
|
||||
const items = fs.readdirSync(path.join(__dirname, dir));
|
||||
const fulldir = path.join(__dirname, dir);
|
||||
const items = fs.readdirSync(fulldir);
|
||||
|
||||
for (const item of items) {
|
||||
if (skipTests.some(test => item.includes(test))) {
|
||||
@@ -18,6 +19,12 @@ function read(dir, createTestCase, skipTests = []) {
|
||||
const testCase = item.replace('.json', '');
|
||||
const testPath = '/' + path.relative(path.resolve(__dirname, '../../..'), path.resolve(__dirname, prefix + item));
|
||||
|
||||
const platforms = require(path.join(fulldir, item)).platforms;
|
||||
if (platforms && !platforms.includes('web')) {
|
||||
console.trace('skip', path.join(fulldir, item));
|
||||
continue;
|
||||
}
|
||||
|
||||
createTestCase(testCase, testPath);
|
||||
} else {
|
||||
describe(item, function() {
|
||||
|
||||
Reference in New Issue
Block a user