This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(*): impl
declaration
option basic support
- Loading branch information
1 parent
12c708c
commit 0169df5
Showing
7 changed files
with
75 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
cleanAndCompile, expect, readOutputFile, | ||
fixturePath, readFixture, expectSource, createConfig | ||
} from './utils'; | ||
|
||
describe('main test', function() { | ||
|
||
it('should emit declaration files', async function() { | ||
// babel need some time to init | ||
this.timeout(10000); | ||
|
||
let config = { | ||
entry: fixturePath(['declaration', 'basic.ts']) | ||
}; | ||
|
||
let loaderQuery = { | ||
declaration: true | ||
}; | ||
|
||
let stats = await cleanAndCompile(createConfig(config, { loaderQuery })); | ||
expect(stats.compilation.errors.length).eq(0); | ||
let assets = Object.keys(stats.compilation.assets); | ||
|
||
expect(assets).to.include('src/test/fixtures/declaration/basic.d.ts'); | ||
|
||
// elided import | ||
expect(assets).to.include('src/test/fixtures/declaration/iface.d.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,3 @@ | ||
import { Iface } from './iface'; | ||
|
||
export function foo(iface: Iface): Iface { return iface; } |
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,4 @@ | ||
|
||
export interface Iface { | ||
name: string; | ||
} |
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