blob: df56c8f9e0e5db27064f946d4a258da0652e21f6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import * as fs from 'fs';
import * as _ from 'lodash';
import * as path from 'path';
import { ContractSource } from '../types';
import { Resolver } from './resolver';
export class SpyResolver extends Resolver {
public resolvedContractSources: ContractSource[] = [];
private _resolver: Resolver;
constructor(resolver: Resolver) {
super();
this._resolver = resolver;
}
public resolveIfExists(importPath: string): ContractSource | undefined {
const contractSourceIfExists = this._resolver.resolveIfExists(importPath);
if (!_.isUndefined(contractSourceIfExists)) {
this.resolvedContractSources.push(contractSourceIfExists);
}
return contractSourceIfExists;
}
}
|