Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-inject rdb/rale tracker logic #131

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 103 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@types/dedent": "^0.7.0",
"@types/find-in-files": "^0.5.1",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/line-column": "^1.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.6",
"@types/request": "^2.48.8",
Expand All @@ -93,19 +93,22 @@
"sinon": "^11.1.2",
"source-map-support": "^0.5.20",
"ts-node": "^10.4.0",
"typescript": "^4.7.2"
"typescript": "^4.4.4",
"undent": "^0.1.0"
},
"dependencies": {
"@rokucommunity/logger": "^0.3.9",
"@types/request": "^2.48.8",
"brighterscript": "^0.67.2",
"brighterscript": "^0.67.3",
"clone-regexp": "2.2.0",
"dateformat": "^4.6.3",
"debounce": "^1.2.1",
"eol": "^0.9.1",
"eventemitter3": "^4.0.7",
"fast-glob": "^3.2.11",
"find-in-files": "^0.5.0",
"fs-extra": "^10.0.0",
"line-column": "^1.0.2",
"natural-orderby": "^2.0.3",
"portfinder": "^1.0.32",
"postman-request": "^2.88.1-postman.32",
Expand Down
20 changes: 14 additions & 6 deletions src/FileUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,38 @@ import { expect } from 'chai';
import * as fsExtra from 'fs-extra';
import * as path from 'path';
import * as sinonActual from 'sinon';

import { SourceNode } from 'source-map';
import { fileUtils, standardizePath as s } from './FileUtils';
import { fileUtils } from './FileUtils';
import { standardizePath as s } from 'brighterscript';
import { SourceMapManager } from './managers/SourceMapManager';

let sinon = sinonActual.createSandbox();
const rootDir = path.normalize(path.dirname(__dirname));
const tempDir = s`${__dirname}/../.tmp`;
const rootDir = s`${tempDir}/rootDir}`;

describe('FileUtils', () => {
let sourceMapManager: SourceMapManager;
beforeEach(() => {
fsExtra.emptydirSync(tempDir);
sourceMapManager = new SourceMapManager();
});
afterEach(() => {
fsExtra.removeSync(tempDir);
sinon.restore();
});

describe('getAllRelativePaths', () => {
//basic test to get code coverage...we don't need to test the glob code too much here...
it('works', async () => {
let paths = await fileUtils.getAllRelativePaths(s`${__dirname}/../src/`);
fsExtra.outputFileSync(s`${tempDir}/file.txt`, '');
fsExtra.outputFileSync(s`${tempDir}/subdir/file.txt`, '');
let paths = await fileUtils.getAllRelativePaths(tempDir);
expect(
paths
).to.contain(`index.ts`);
paths.sort()
).to.eql([
'file.txt',
s`subdir/file.txt`
]);
});
});

Expand Down
Loading
Loading