Skip to content

Commit

Permalink
fix(fs): do not skip specs in ts.sys
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Dec 31, 2019
1 parent da208a7 commit d753e38
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
1 change: 1 addition & 0 deletions src/compiler_next/sys/in-memory-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export const createInMemoryFs = (sys: d.CompilerSystem) => {

/**
* Synchronous!!! Do not use!!!
* Always returns an object, does not throw errors.
* (Only typescript transpiling is allowed to use)
* @param itemPath
*/
Expand Down
23 changes: 0 additions & 23 deletions src/compiler_next/sys/typescript/typescript-sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ export const getTypeScriptSys = async (config: d.Config, inMemoryFs: d.InMemoryF


const patchTsSystemFileSystem = (config: d.Config, stencilSys: d.CompilerSystem, inMemoryFs: d.InMemoryFileSystem, tsSys: ts.System) => {
const skipFile = (readPath: string) => {
// filter e2e tests
if (readPath.includes('.e2e.') || readPath.includes('/e2e.')) {
// keep this test if it's an e2e file and we should be testing e2e
return true;
}

// filter spec tests
if (readPath.includes('.spec.') || readPath.includes('/spec.')) {
return true;
}
return false;
};

const realpath = (path: string) => {
const rp = stencilSys.realpathSync(path);
if (rp) {
Expand Down Expand Up @@ -72,17 +58,11 @@ const patchTsSystemFileSystem = (config: d.Config, stencilSys: d.CompilerSystem,
tsSys.createDirectory = (p) => stencilSys.mkdirSync(p);

tsSys.directoryExists = (p) => {
if (skipFile(p)) {
return false;
}
const s = inMemoryFs.statSync(p);
return s.isDirectory;
};

tsSys.fileExists = (p) => {
if (skipFile(p)) {
return false;
}
const s = inMemoryFs.statSync(p);
return s.isFile;
};
Expand All @@ -101,9 +81,6 @@ const patchTsSystemFileSystem = (config: d.Config, stencilSys: d.CompilerSystem,
};

tsSys.readFile = (p) => {
if (skipFile(p)) {
return undefined;
}
const isUrl = p.startsWith('https:') || p.startsWith('http:');
let content = inMemoryFs.readFileSync(p, { useCache: isUrl });

Expand Down

0 comments on commit d753e38

Please sign in to comment.