forked from KatChaotic/sveltedoc-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(options): Add integration tests for version auto-detect
- revert detectedVersion => version - Fix typedef for FileStructure - Small code changes - Small test changes
- Loading branch information
1 parent
f5d0d39
commit a438a40
Showing
8 changed files
with
49 additions
and
14 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
export default {}; | ||
</script> |
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,3 @@ | ||
<script context="module"> | ||
let staticVariable = 0; | ||
</script> |
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,35 @@ | ||
const path = require('path'); | ||
const chai = require('chai'); | ||
const expect = chai.expect; | ||
|
||
const parser = require('./../../../index'); | ||
|
||
describe('parse - Integration', () => { | ||
it('should correctly auto-detect svelte V2 component', (done) => { | ||
parser.parse({ | ||
filename: path.resolve(__dirname, 'basicV2.svelte'), | ||
}).then((doc) => { | ||
expect(doc, 'Document should exist').to.exist; | ||
// v3-parser converts component name to kebab-case | ||
expect(doc.name).to.equal('basic-v2'); | ||
|
||
done(); | ||
}).catch(e => { | ||
done(e); | ||
}); | ||
}); | ||
|
||
it('should correctly auto-detect svelte V3 component', (done) => { | ||
parser.parse({ | ||
filename: path.resolve(__dirname, 'basicV3.svelte'), | ||
}).then((doc) => { | ||
expect(doc, 'Document should be provided').to.exist; | ||
// v3-parser converts component name to PascalCase | ||
expect(doc.name).to.equal('BasicV3'); | ||
|
||
done(); | ||
}).catch(e => { | ||
done(e); | ||
}); | ||
}); | ||
}); |
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