Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 64ee37f

Browse files
kyo-agoexoego
authored andcommitted
Test that the TypeScript files in our tests actually compile with tsc (#56)
1 parent 20dbbfd commit 64ee37f

34 files changed

+40
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ target/
55
.classpath
66
.project
77
.settings/
8+
/node_modules
9+
/package-lock.json

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ scala: 2.12.3
55

66
jdk: oraclejdk8
77

8-
script: sbt ++$TRAVIS_SCALA_VERSION samples/compile test
8+
script:
9+
- sbt ++$TRAVIS_SCALA_VERSION samples/compile test
10+
- $(npm bin)/tsc samples/*.d.ts
911

1012
before_cache:
1113
# See http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
1214
# Tricks to avoid unnecessary cache updates
1315
- find $HOME/.sbt -name "*.lock" | xargs rm
1416
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
1517

18+
install:
19+
- . $HOME/.nvm/nvm.sh
20+
- nvm install 8
21+
- nvm use 8
22+
- npm install typescript@2.6.2
23+
1624
cache:
1725
directories:
1826
- $HOME/.ivy2/cache
1927
- $HOME/.sbt/boot
28+
- node_modules

samples/assets/module.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module "module" {
2+
const value: any;
3+
export const Single: any;
4+
export const First: any;
5+
export const Second: any;
6+
export const Third: any;
7+
export const Fourth: any;
8+
export const Fifth: any;
9+
export default value;
10+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// copy from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/index.d.ts
22
declare interface LoDashStatic {
33
at<T extends object>();
4-
};
5-
4+
}
File renamed without changes.

samples/import.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="./assets/module" />
2+
// Import variants from https://www.typescriptlang.org/docs/handbook/modules.html#import
3+
4+
import Default from "module";
5+
import { Single } from "module";
6+
import { Single as Renamed } from "module";
7+
import { First, Second } from "module";
8+
import { Third as T, Fourth } from "module";
9+
import * as validator from "module";
10+
import "./assets/module";
11+
12+
declare const hello: String;
13+
14+
declare module mod {
15+
export function f(x: Number): String;
16+
}

0 commit comments

Comments
 (0)