function mockTargetAndReferenceProject(searchTargetProject, referenceProject) {
  const targetProjectName = searchTargetProject.name || 'fictional-target-project';
  const refProjectName = referenceProject.name || 'fictional-ref-project';

  const targetcodeSnippets = searchTargetProject.files.map(f => f.code);
  const targetFilePaths = searchTargetProject.files.map(f => f.file);
  const refVersion = referenceProject.version || '1.0.0';
  const refcodeSnippets = referenceProject.files.map(f => f.code);
  const refFilePaths = referenceProject.files.map(f => f.file);

  createPackageJson({
    filePaths: targetFilePaths,
    codeSnippets: targetcodeSnippets,
    projectName: targetProjectName,
    refProjectName,
    refVersion,
  });

  createPackageJson({
    filePaths: refFilePaths,
    codeSnippets: refcodeSnippets,
    projectName: refProjectName,
  });

  // Create target mock
  const targetMock = getMockObjectForProject(targetcodeSnippets, {
    filePaths: targetFilePaths,
    projectName: targetProjectName,
    projectPath: searchTargetProject.path || 'fictional/target/project',
  });

  // Append ref mock
  mockProject(
    referenceProject.files.map(f => f.code),
    {
      filePaths: referenceProject.files.map(f => f.file),
      projectName: refProjectName,
      projectPath: referenceProject.path || 'fictional/ref/project',
      version: refVersion,
    },
    targetMock,
  );
}
Requires two config objects (see match-imports and match-subclasses tests)
and based on those, will use mock-fs package to mock them in the file system.
All missing information (like target depending on ref, version numbers, project names
and paths will be auto generated when not specified.)
When a non imported ref dependency or a wrong version of a dev dependency needs to be
tested, please explicitly provide a ./package.json that does so.