fix: preserve transversal regression contracts and lock budget during confirmation
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { compileFunction } from 'node:vm';
|
||||
import { createRequire } from 'node:module';
|
||||
import React from 'react';
|
||||
@@ -56,7 +57,7 @@ function load(file) {
|
||||
Link: ({ children, href }) =>
|
||||
React.createElement('a', { href }, children),
|
||||
router: {},
|
||||
useForm: (data) => ({ data, setData() {}, get() {} }),
|
||||
useForm: (data) => ({ data, errors: {}, setData() {}, get() {} }),
|
||||
}
|
||||
: name === './shared'
|
||||
? { windowLabels: {} }
|
||||
@@ -79,7 +80,7 @@ function load(file) {
|
||||
? load(
|
||||
'components/funding-criteria-assessment.tsx',
|
||||
)
|
||||
: require(name),
|
||||
: resolveLocal(name, file),
|
||||
module,
|
||||
module.exports,
|
||||
);
|
||||
@@ -296,3 +297,12 @@ test('contact and location deduplication preserves different branches and origin
|
||||
);
|
||||
assert.equal(JSON.stringify(moza), original);
|
||||
});
|
||||
|
||||
function resolveLocal(name, parent) {
|
||||
if (name === './territory-geometry-preview') return { default: () => null };
|
||||
const relative = name.startsWith('@/') ? name.slice(2) : name.startsWith('.') ? path.posix.join(path.posix.dirname(parent), name) : null;
|
||||
if (relative) for (const candidate of [relative, relative + '.tsx', relative + '.ts']) {
|
||||
if (fs.existsSync(new URL('../../resources/js/' + candidate, import.meta.url))) return load(candidate);
|
||||
}
|
||||
return require(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user