fix tests, typescript
This commit is contained in:
parent
b7ea05c77c
commit
e122c60f2d
3 changed files with 6 additions and 6 deletions
|
@ -25,7 +25,7 @@ interface IReadFile {
|
|||
const readFile = denodeify<string, string, string>(fs.readFile);
|
||||
const writeFile = denodeify<string, string, string, void>(fs.writeFile as any);
|
||||
const unlink = denodeify<string, void>(fs.unlink as any);
|
||||
const exec = denodeify<string, { cwd?: string; env?: any; }, { stdout: string; stderr: string; }>(cp.exec, (err, stdout, stderr) => [err, { stdout, stderr }]);
|
||||
const exec = denodeify<string, { cwd?: string; env?: any; }, { stdout: string; stderr: string; }>(cp.exec as any, (err, stdout, stderr) => [err, { stdout, stderr }]);
|
||||
const glob = denodeify<string, _glob.Options, string[]>(_glob);
|
||||
|
||||
const resourcesPath = path.join(path.dirname(__dirname), 'resources');
|
||||
|
|
|
@ -6,7 +6,7 @@ import { validatePublisher } from './validation';
|
|||
import * as denodeify from 'denodeify';
|
||||
|
||||
const readFile = denodeify<string, string, string>(fs.readFile);
|
||||
const writeFile = denodeify<string, string, void>(fs.writeFile);
|
||||
const writeFile = denodeify<string, string, void>(fs.writeFile as any);
|
||||
const storePath = path.join(home(), '.vsce');
|
||||
|
||||
export interface IPublisher {
|
||||
|
|
|
@ -1191,10 +1191,10 @@ describe('toContentTypes', () => {
|
|||
return toContentTypes(files)
|
||||
.then(xml => parseContentTypes(xml))
|
||||
.then(result => {
|
||||
assert.ok(result.Types.Default);
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.txt' && d.$.ContentType === 'text/plain'));
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.png' && d.$.ContentType === 'image/png'));
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.md' && d.$.ContentType === 'text/x-markdown'));
|
||||
assert.ok(result.Types.Default, 'there are content types');
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.txt' && d.$.ContentType === 'text/plain'), 'there are txt');
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.png' && d.$.ContentType === 'image/png'), 'there are png');
|
||||
assert.ok(result.Types.Default.some(d => d.$.Extension === '.md' && /^text\/(x-)?markdown$/.test(d.$.ContentType)), 'there are md');
|
||||
assert.ok(!result.Types.Default.some(d => d.$.Extension === ''));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue