Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Commit

Permalink
fix tests on windows (attempt 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
olback committed Aug 7, 2019
1 parent cec1696 commit 0dfa536
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ test_script:
- npm test

# Don't actually build.
build: false
build: off

branches:
only:
- "3.0"
# branches:
# only:
# - "3.0"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "node --max_old_space_size=4096 node_modules/.bin/webpack --mode production",
"watch": "node_modules/.bin/webpack --mode development --watch",
"compile": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack --mode production",
"watch": "node node_modules/webpack/bin/webpack --mode development --watch",
"pretest": "npm run compile && npm run ts:compile",
"ts:compile": "tsc -p ./",
"test": "node --max_old_space_size=4096 ./out/test/runTest.js",
Expand Down
16 changes: 11 additions & 5 deletions src/test/suite/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import { File, DataFormat } from '../../fs';
import * as assert from 'assert';
import * as fs from 'fs';
import * as path from 'path';
import { EXT_ID } from '../../utils';
import { EXT_ROOT } from './test_utils';

suite('File class', () => {

test('Open file', () => {

assert.doesNotThrow(() => {

const packagePath = path.join(EXT_ROOT, 'package.json');
// tslint:disable-next-line:no-unused-expression
new File('package.json').read();
new File(packagePath).read();

});

});

test('Read file', () => {

const data = new File('package.json').read();
const packagePath = path.join(EXT_ROOT, 'package.json');
const data = new File(packagePath).read();

assert.strictEqual(typeof data, 'string');
assert.ok(data.length > 0);
Expand All @@ -27,7 +31,8 @@ suite('File class', () => {

test('Parse file', () => {

const data = new File('package.json').parse(DataFormat.json);
const packagePath = path.join(EXT_ROOT, 'package.json');
const data = new File(packagePath).parse(DataFormat.json);

assert.ok(data);
assert.strictEqual(typeof data, 'object');
Expand All @@ -37,7 +42,8 @@ suite('File class', () => {

test('File exists', () => {

const exists = new File('package.json').exists();
const packagePath = path.join(EXT_ROOT, 'package.json');
const exists = new File(packagePath).exists();

assert.equal(exists, true);

Expand All @@ -53,7 +59,7 @@ suite('File class', () => {

test('Write file', () => {

const filePath = '.ignoreme';
const filePath = path.join(EXT_ROOT, '.ignoreme');
const data ='this is a test';
const file = new File(filePath);
file.write(data);
Expand Down
1 change: 1 addition & 0 deletions src/test/suite/test_utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'path';

export const WORKSPACE_PATH = path.join(__dirname, '..', '..', '..', 'src', 'test', 'workspace');
export const EXT_ROOT = path.join(__dirname, '..', '..', '..');

0 comments on commit 0dfa536

Please sign in to comment.