style: align multiline ternary operators
This commit is contained in:
@@ -64,13 +64,13 @@ async function check(name, overrides = {}, signal) {
|
||||
'user database must be untouched',
|
||||
);
|
||||
const expected =
|
||||
signal === 'SIGINT' ?
|
||||
130 :
|
||||
signal === 'SIGTERM' ?
|
||||
143 :
|
||||
overrides.PRISMA_SCHEMA_ENGINE_BINARY ?
|
||||
1 :
|
||||
0;
|
||||
signal === 'SIGINT'
|
||||
? 130
|
||||
: signal === 'SIGTERM'
|
||||
? 143
|
||||
: overrides.PRISMA_SCHEMA_ENGINE_BINARY
|
||||
? 1
|
||||
: 0;
|
||||
assert.equal(code, expected, `See ${name}.log`);
|
||||
console.log(`PASS ${name}: ${dirs.length} isolated databases`);
|
||||
}
|
||||
|
||||
+5
-5
@@ -9,11 +9,11 @@ const available = readdirSync(__dirname)
|
||||
.sort();
|
||||
const requested = process.argv.slice(2);
|
||||
const suites =
|
||||
requested.length === 0 ?
|
||||
['app.e2e-spec.ts', 'bank-cards.e2e-spec.ts'] :
|
||||
requested.length === 1 && requested[0] === '--all' ?
|
||||
available :
|
||||
requested;
|
||||
requested.length === 0
|
||||
? ['app.e2e-spec.ts', 'bank-cards.e2e-spec.ts']
|
||||
: requested.length === 1 && requested[0] === '--all'
|
||||
? available
|
||||
: requested;
|
||||
if (suites.some((suite) => !available.includes(suite))) {
|
||||
throw new Error('Unknown e2e suite');
|
||||
}
|
||||
|
||||
@@ -240,9 +240,9 @@ describe('persistent ledger HTTP and cursor (SQLite)', () => {
|
||||
data: { occurredAt: new Date(observedAt.valueOf() - 1000) },
|
||||
});
|
||||
const query =
|
||||
periodKind === 'default' ?
|
||||
'' :
|
||||
`&to=${observedAt.toISOString().slice(0, 10)}${periodKind === 'today timestamp' ? 'T23:59:59.999Z' : ''}`;
|
||||
periodKind === 'default'
|
||||
? ''
|
||||
: `&to=${observedAt.toISOString().slice(0, 10)}${periodKind === 'today timestamp' ? 'T23:59:59.999Z' : ''}`;
|
||||
const page = (cursor?: string, observe = false) =>
|
||||
request(app.getHttpServer())
|
||||
.get(
|
||||
|
||||
@@ -339,9 +339,9 @@ describe('local accounts and portfolio HTTP (SQLite)', () => {
|
||||
]);
|
||||
await put().expect(200);
|
||||
upstream.getPortfolio.mockImplementation((_token, id) =>
|
||||
id === 'second' ?
|
||||
Promise.reject(new Error('synthetic unavailable')) :
|
||||
Promise.resolve({
|
||||
id === 'second'
|
||||
? Promise.reject(new Error('synthetic unavailable'))
|
||||
: Promise.resolve({
|
||||
positions: [
|
||||
{
|
||||
instrumentUid: uid,
|
||||
|
||||
@@ -351,9 +351,9 @@ describe('durable shared instrument metadata (SQLite)', () => {
|
||||
await service.read('owner', identity);
|
||||
await settled();
|
||||
const identities = Array.from({ length: 1000 }, (_, index) =>
|
||||
index ?
|
||||
{ instrumentUid: `uid-${index}`, figi: `FIGI-${index}` } :
|
||||
identity,
|
||||
index
|
||||
? { instrumentUid: `uid-${index}`, figi: `FIGI-${index}` }
|
||||
: identity,
|
||||
);
|
||||
const saved = await service.savedMany(identities);
|
||||
expect(saved.size).toBe(1000);
|
||||
|
||||
@@ -58,9 +58,9 @@ describe('T-Bank persisted read budget', () => {
|
||||
const operations = Array.from({ length: 100_000 }, (_, index) => {
|
||||
// 1,000 measured-month rows, 200 income receipts, remaining rows over 10 years.
|
||||
const time =
|
||||
index < 1000 ?
|
||||
Date.UTC(2026, 7, 1) + index * 2_500_000 :
|
||||
Date.UTC(2016, 8, 1) + (index - 1000) * 3_160_000;
|
||||
index < 1000
|
||||
? Date.UTC(2026, 7, 1) + index * 2_500_000
|
||||
: Date.UTC(2016, 8, 1) + (index - 1000) * 3_160_000;
|
||||
const instrument = instruments[index % instruments.length];
|
||||
return {
|
||||
id: `operation-${index}`,
|
||||
@@ -298,9 +298,9 @@ describe('T-Bank persisted read budget', () => {
|
||||
uid: instrument.uid,
|
||||
ticker: instrument.ticker,
|
||||
instrumentType:
|
||||
instrument.instrumentKind === 'INSTRUMENT_TYPE_SHARE' ?
|
||||
'share' :
|
||||
'bond',
|
||||
instrument.instrumentKind === 'INSTRUMENT_TYPE_SHARE'
|
||||
? 'share'
|
||||
: 'bond',
|
||||
metadata: instrument,
|
||||
fetchedAt: now,
|
||||
},
|
||||
@@ -487,13 +487,13 @@ describe('T-Bank persisted read budget', () => {
|
||||
runtime: process.version,
|
||||
hardware: {
|
||||
cpuQuota:
|
||||
process.platform === 'linux' ?
|
||||
readFileSync('/sys/fs/cgroup/cpu.max', 'utf8').trim() :
|
||||
null,
|
||||
process.platform === 'linux'
|
||||
? readFileSync('/sys/fs/cgroup/cpu.max', 'utf8').trim()
|
||||
: null,
|
||||
memoryLimit:
|
||||
process.platform === 'linux' ?
|
||||
readFileSync('/sys/fs/cgroup/memory.max', 'utf8').trim() :
|
||||
null,
|
||||
process.platform === 'linux'
|
||||
? readFileSync('/sys/fs/cgroup/memory.max', 'utf8').trim()
|
||||
: null,
|
||||
cpu: cpus()[0]?.model,
|
||||
cpus: cpus().length,
|
||||
memoryBytes: totalmem(),
|
||||
|
||||
@@ -358,9 +358,9 @@ describe('screen sync HTTP and SQLite', () => {
|
||||
}),
|
||||
)
|
||||
.mockImplementation(() =>
|
||||
outcome === 'failed' ?
|
||||
Promise.reject(new Error('Synthetic outage')) :
|
||||
Promise.resolve({ hasNext: false, items: [] }),
|
||||
outcome === 'failed'
|
||||
? Promise.reject(new Error('Synthetic outage'))
|
||||
: Promise.resolve({ hasNext: false, items: [] }),
|
||||
);
|
||||
const accept = async (from: string, to: string) => {
|
||||
const response = await post({
|
||||
|
||||
@@ -296,9 +296,9 @@ describe('saved payout calendars and complete forecasts (SQLite HTTP)', () => {
|
||||
.body as UpcomingEventsResourceDto;
|
||||
await portfolio([position(shareUid, '7'), position(newUid, '5')]);
|
||||
upstream.getDividends.mockImplementation((_token: string, uid: string) =>
|
||||
uid === newUid ?
|
||||
Promise.reject(new Error('new calendar unavailable')) :
|
||||
Promise.resolve([]),
|
||||
uid === newUid
|
||||
? Promise.reject(new Error('new calendar unavailable'))
|
||||
: Promise.resolve([]),
|
||||
);
|
||||
const pending = (await events(false).expect(200))
|
||||
.body as UpcomingEventsResourceDto;
|
||||
|
||||
Reference in New Issue
Block a user