-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
tests/extensionTester/dependencyTester/tsx/dependencyTreeData/dependencyNodes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"%DIR-PATH%\\src\\index.js": { | ||
"absolutePath": "%DIR-PATH%\\src\\index.js", | ||
"ancestors": [], | ||
"children": [ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\tsx.tsx", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js" | ||
], | ||
"extension": ".tsx", | ||
"name": "tsx.tsx", | ||
"relativePath": "\\src\\tsx.tsx", | ||
"children": [ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\my.js", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js", | ||
"%DIR-PATH%\\src\\tsx.tsx" | ||
], | ||
"extension": ".js", | ||
"name": "my.js", | ||
"relativePath": "\\src\\my.js", | ||
"children": [], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 1, | ||
"functions": [] | ||
} | ||
], | ||
"fileDescription": {}, | ||
"type": "react_ts", | ||
"language": "file" | ||
} | ||
], | ||
"extension": ".js", | ||
"name": "index.js", | ||
"relativePath": "\\src\\index.js", | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 2, | ||
"functions": [] | ||
}, | ||
"%DIR-PATH%\\src\\tsx.tsx": { | ||
"absolutePath": "%DIR-PATH%\\src\\tsx.tsx", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js" | ||
], | ||
"extension": ".tsx", | ||
"name": "tsx.tsx", | ||
"relativePath": "\\src\\tsx.tsx", | ||
"children": [ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\my.js", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js", | ||
"%DIR-PATH%\\src\\tsx.tsx" | ||
], | ||
"extension": ".js", | ||
"name": "my.js", | ||
"relativePath": "\\src\\my.js", | ||
"children": [], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 1, | ||
"functions": [] | ||
} | ||
], | ||
"fileDescription": {}, | ||
"type": "react_ts", | ||
"language": "file" | ||
}, | ||
"%DIR-PATH%\\src\\my.js": { | ||
"absolutePath": "%DIR-PATH%\\src\\my.js", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js", | ||
"%DIR-PATH%\\src\\tsx.tsx" | ||
], | ||
"extension": ".js", | ||
"name": "my.js", | ||
"relativePath": "\\src\\my.js", | ||
"children": [], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 1, | ||
"functions": [] | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
tests/extensionTester/dependencyTester/tsx/dependencyTreeData/dependencyTree.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\index.js", | ||
"ancestors": [], | ||
"children": [ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\tsx.tsx", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js" | ||
], | ||
"extension": ".tsx", | ||
"name": "tsx.tsx", | ||
"relativePath": "\\src\\tsx.tsx", | ||
"children": [ | ||
{ | ||
"absolutePath": "%DIR-PATH%\\src\\my.js", | ||
"ancestors": [ | ||
"%DIR-PATH%\\src\\index.js", | ||
"%DIR-PATH%\\src\\tsx.tsx" | ||
], | ||
"extension": ".js", | ||
"name": "my.js", | ||
"relativePath": "\\src\\my.js", | ||
"children": [], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 1, | ||
"functions": [] | ||
} | ||
], | ||
"fileDescription": {}, | ||
"type": "react_ts", | ||
"language": "file" | ||
} | ||
], | ||
"extension": ".js", | ||
"name": "index.js", | ||
"relativePath": "\\src\\index.js", | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"analysed": true, | ||
"lines": 2, | ||
"functions": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./tsx.tsx"; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import my from './my' | ||
|
||
function App(options) { | ||
return <>hello world</> | ||
} | ||
|
||
export default App |
49 changes: 49 additions & 0 deletions
49
tests/extensionTester/dependencyTester/tsx/requireModule.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { | ||
getDependencyTreeDataFromFile, | ||
getDependencyTreeDataByCompute, | ||
getWebViewDataByCompute, | ||
getSavedDataFromFile, | ||
getSavedDataByCompute, | ||
getWebViewDataFromFile, | ||
setDataToFile | ||
} from "../utils"; | ||
import { expect } from 'chai'; | ||
const mainFilePath = "./src/index.js"; | ||
const { | ||
dependencyTreeData, | ||
dependencyNodesData, | ||
folderPath, | ||
} = getDependencyTreeDataFromFile("tsx"); | ||
// const folderPath = path.join(__dirname, `./files`) | ||
const { dependencyTree, dependencyNodes } = getDependencyTreeDataByCompute( | ||
folderPath, | ||
mainFilePath | ||
); | ||
const savedDataFromFile = getSavedDataFromFile("tsx"); | ||
const savedDataByCompute = getSavedDataByCompute( | ||
"tsx", | ||
folderPath, | ||
mainFilePath | ||
); | ||
const readData = getWebViewDataByCompute("tsx", folderPath); | ||
const webViewData = getWebViewDataFromFile("tsx"); | ||
describe("dependencyTree(tsx): get dependencyTree data", function () { | ||
it("dependencyNodesData", function () { | ||
expect(dependencyNodesData.length).to.equal(dependencyNodes.length); | ||
}); | ||
it("dependencyTreeData", function () { | ||
expect(dependencyTreeData.length).to.equal(dependencyTree.length); | ||
}); | ||
}); | ||
|
||
describe("dependencyTree(tsx): get saved data", function () { | ||
it("jsonString", function () { | ||
expect(savedDataFromFile.length).to.equal(savedDataByCompute.length); | ||
}); | ||
}); | ||
|
||
describe("dependencyTree(tsx): get webView data", function () { | ||
it("dependencyTreeData", function () { | ||
expect(readData.length).to.equal(webViewData.length); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
tests/extensionTester/dependencyTester/tsx/savedData/savedData.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"dependencyTree":{"name":"index.js","ancestors":[],"fileID":"43351ecb56f3a7e10f80143f717fe4ea","nodeID":"43351ecb56f3a7e10f80143f717fe4ea","children":[{"name":"tsx.tsx","ancestors":["43351ecb56f3a7e10f80143f717fe4ea"],"fileID":"da0acda11625edcc51dde30cd2802fc2","nodeID":"9fe3fcd7c02b5894297ff213d90e989c","children":[{"name":"my.js","ancestors":["43351ecb56f3a7e10f80143f717fe4ea","da0acda11625edcc51dde30cd2802fc2"],"fileID":"6ac94e8f6bdf69e3667d5a6106a7c234","nodeID":"15ca17f27495df1a606c46c980b8cd75","children":[]}]}]},"dependencyNodes":{"43351ecb56f3a7e10f80143f717fe4ea":{"fileID":"43351ecb56f3a7e10f80143f717fe4ea","name":"index.js","type":"javascript","extension":".js","language":"javascript","lines":2,"analysed":true,"relativePath":"\\src\\index.js","fileDescription":{},"functions":[],"children":["da0acda11625edcc51dde30cd2802fc2"]},"da0acda11625edcc51dde30cd2802fc2":{"fileID":"da0acda11625edcc51dde30cd2802fc2","name":"tsx.tsx","type":"react_ts","extension":".tsx","language":"file","relativePath":"\\src\\tsx.tsx","fileDescription":{},"children":["6ac94e8f6bdf69e3667d5a6106a7c234"]},"6ac94e8f6bdf69e3667d5a6106a7c234":{"fileID":"6ac94e8f6bdf69e3667d5a6106a7c234","name":"my.js","type":"javascript","extension":".js","language":"javascript","lines":1,"analysed":true,"relativePath":"\\src\\my.js","fileDescription":{},"functions":[],"children":[]}}} |
52 changes: 52 additions & 0 deletions
52
tests/extensionTester/dependencyTester/tsx/webViewData/webViewData.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "index.js", | ||
"fileID": "43351ecb56f3a7e10f80143f717fe4ea", | ||
"nodeID": "43351ecb56f3a7e10f80143f717fe4ea", | ||
"ancestors": [], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"lines": 2, | ||
"analysed": true, | ||
"functions": [], | ||
"extension": ".js", | ||
"absolutePath": "%DIR-PATH%\\src\\index.js", | ||
"relativePath": "\\src\\index.js", | ||
"children": [ | ||
{ | ||
"name": "tsx.tsx", | ||
"fileID": "da0acda11625edcc51dde30cd2802fc2", | ||
"nodeID": "9fe3fcd7c02b5894297ff213d90e989c", | ||
"ancestors": [ | ||
"43351ecb56f3a7e10f80143f717fe4ea" | ||
], | ||
"fileDescription": {}, | ||
"type": "react_ts", | ||
"language": "file", | ||
"extension": ".tsx", | ||
"absolutePath": "%DIR-PATH%\\src\\tsx.tsx", | ||
"relativePath": "\\src\\tsx.tsx", | ||
"children": [ | ||
{ | ||
"name": "my.js", | ||
"fileID": "6ac94e8f6bdf69e3667d5a6106a7c234", | ||
"nodeID": "15ca17f27495df1a606c46c980b8cd75", | ||
"ancestors": [ | ||
"43351ecb56f3a7e10f80143f717fe4ea", | ||
"da0acda11625edcc51dde30cd2802fc2" | ||
], | ||
"fileDescription": {}, | ||
"type": "javascript", | ||
"language": "javascript", | ||
"lines": 1, | ||
"analysed": true, | ||
"functions": [], | ||
"extension": ".js", | ||
"absolutePath": "%DIR-PATH%\\src\\my.js", | ||
"relativePath": "\\src\\my.js", | ||
"children": [] | ||
} | ||
] | ||
} | ||
] | ||
} |