forked from jaime-olivares/vscode-yuml
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: Fixed issue jaime-olivares/yuml-diagram#18
- Loading branch information
1 parent
4904294
commit ef3c14d
Showing
5 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1 +1,18 @@ | ||
// TODO : Unit tests | ||
const yuml2svg = require(".."); | ||
const { promises: fs } = require("fs"); | ||
|
||
const inputFile = require.resolve("./test.yuml"); | ||
const outputFile = require.resolve("./test.yuml.svg"); | ||
|
||
Promise.all([fs.readFile(inputFile).then(yuml2svg), fs.readFile(outputFile)]) | ||
.then(([actual, expectedOutput]) => { | ||
const actualOutput = Buffer.from(actual); | ||
if (Buffer.compare(actualOutput, expectedOutput) === 0) { | ||
return Promise.resolve("Success"); | ||
} else { | ||
console.warn("Output has been modified"); | ||
|
||
return fs.writeFile(outputFile, actualOutput); | ||
} | ||
}) | ||
.then(console.log, console.error); |
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,5 @@ | ||
// {type:class} | ||
// {direction:topDown} | ||
[a]->[<<b>>|c] | ||
[e]->[<<b>>] | ||
[f]->[c] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.