diff --git a/.travis.yml b/.travis.yml index b57c0da..c96519e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,6 @@ language: node_js node_js: - "7.0" -before_install: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - script: - npm run build - npm run build:test diff --git a/package.json b/package.json index 4802824..75c18f0 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,13 @@ "@types/mockery": "^1.4.29", "@types/node": "^6.0.41", "@types/source-map": "^0.1.27", + "@types/tmp": "0.0.32", "chrome-remote-debug-protocol": "^1.2.20161007", "glob": "^7.1.1", "gulp": "^3.9.1", "mocha": "^3.0.2", "mockery": "^1.7.0", + "tmp": "0.0.31", "ts-loader": "^1.0.0", "tslint": "^3.15.1", "typemoq": "^0.3.3", @@ -48,7 +50,8 @@ "build:test": "tsc -p test/tsconfig.json", "watch": "webpack -w", "watch:test": "tsc -p test/tsconfig.json -w", - "test": "mocha --timeout 20000 -s 2000 -u tdd --colors --reporter out/test/int/loggingReporter.js './out/test/**/*.test.js'", + "test": "mocha --timeout 20000 -s 2000 -u tdd --colors './out/test/*.test.js'", + "intTest": "mocha --timeout 20000 -s 2000 -u tdd --colors --reporter out/test/int/loggingReporter.js './out/test/int/*.test.js'", "lint": "tslint -t verbose 'src/**/*.ts' 'test/**/*.ts'", "vscode:prepublish": "gulp verify-no-linked-modules" }, diff --git a/test/int/adapter.test.ts b/test/int/adapter.test.ts index 0837091..6c2a76c 100644 --- a/test/int/adapter.test.ts +++ b/test/int/adapter.test.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import {DebugClient} from 'vscode-debugadapter-testsupport'; import {DebugProtocol} from 'vscode-debugprotocol'; -import * as testUtils from './testUtils'; +import * as testUtils from './intTestUtils'; import * as testSetup from './testSetup'; const DATA_ROOT = testSetup.DATA_ROOT; diff --git a/test/int/testUtils.ts b/test/int/intTestUtils.ts similarity index 100% rename from test/int/testUtils.ts rename to test/int/intTestUtils.ts diff --git a/test/int/testSetup.ts b/test/int/testSetup.ts index ccd18c5..136746a 100644 --- a/test/int/testSetup.ts +++ b/test/int/testSetup.ts @@ -5,6 +5,7 @@ import * as os from 'os'; import * as path from 'path'; +import * as tmp from 'tmp'; import {DebugProtocol} from 'vscode-debugprotocol'; import {DebugClient} from 'vscode-debugadapter-testsupport'; @@ -66,8 +67,8 @@ function log(e: DebugProtocol.OutputEvent) { function patchLaunchArgFns(): void { function patchLaunchArgs(launchArgs) { launchArgs.verboseDiagnosticLogging = true; - launchArgs.userDataDir = `/tmp/chrome-${Math.random()}/`; - launchArgs.runtimeExecutable = 'chromium-browser'; + const tmpDir = tmp.dirSync({ prefix: 'chrome-' }); + launchArgs.userDataDir = tmpDir.name; } const origLaunch = dc.launch; diff --git a/testdata/simple/app.js b/testdata/simple/app.js new file mode 100644 index 0000000..015be31 --- /dev/null +++ b/testdata/simple/app.js @@ -0,0 +1,5 @@ +function log() { + console.log('Very simple webpage'); +} + +log(); \ No newline at end of file diff --git a/testdata/simple/index.html b/testdata/simple/index.html new file mode 100644 index 0000000..c41df5c --- /dev/null +++ b/testdata/simple/index.html @@ -0,0 +1,8 @@ + + + + + +

Hello, world!

+ + \ No newline at end of file