Skip to content

Commit 2c3a178

Browse files
committed
Tweak test locations
1 parent 3159891 commit 2c3a178

22 files changed

+9
-2
lines changed

compatible.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import { LogicEngine, AsyncLogicEngine } from './index.js'
44

55
const tests = []
66

7-
// get all json files from "suites" directory
8-
const files = fs.readdirSync('./suites')
7+
// get all json files from "suites" directory, 1 layer of depth
8+
const files = fs.readdirSync('./suites', { withFileTypes: true }).flatMap(i => {
9+
if (i.isDirectory()) return fs.readdirSync(`./suites/${i.name}`).map(j => `${i.name}/${j}`)
10+
return i.name
11+
})
12+
913
for (const file of files) {
1014
if (file.endsWith('.json')) {
1115
tests.push(...JSON.parse(fs.readFileSync(`./suites/${file}`).toString()).filter(i => typeof i !== 'string').map(i => {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

suites/control/and.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

suites/control/if.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

suites/control/or.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)