Fix the test

This commit is contained in:
lujjjh 2018-03-27 10:57:17 +08:00
parent 33f732644f
commit 3685b3acd8
No known key found for this signature in database
GPG key ID: 16ADAEFFEB4C91FB

View file

@ -15,7 +15,7 @@
var require = {
paths: {
'vs/basic-languages': '../node_modules/monaco-languages/release',
'vs/language/yaml': '../release/dev',
'vs/languages/yaml': '../release/dev',
'vs': '../node_modules/monaco-editor-core/dev/vs'
}
};
@ -27,78 +27,32 @@
<script>
require([
'vs/basic-languages/src/monaco.contribution',
'vs/language/yaml/monaco.contribution'
'vs/languages/yaml/monaco.contribution'
], function() {
monaco.languages.yaml.yamlDefaults.setDiagnosticsOptions({
validate: true,
schemas: [{
fileMatch: ['*'],
schema: {
title: 'Person',
type: 'object',
properties: {
name: { type: 'string' },
age: {
description: 'Age in years',
type: 'integer',
minimum: 0
}
},
required: ['name']
}
}]
});
var editor = monaco.editor.create(document.getElementById('container'), {
value: [
'{',
' "type": "team",',
' "test": {',
' "testPage": "tools/testing/run-tests.htm",',
' "enabled": true',
' },',
' "search": {',
' "excludeFolders": [',
' ".git",',
' "node_modules",',
' "tools/bin",',
' "tools/counts",',
' "tools/policheck",',
' "tools/tfs_build_extensions",',
' "tools/testing/jscoverage",',
' "tools/testing/qunit",',
' "tools/testing/chutzpah",',
' "server.net"',
' ]',
' },',
' "languages": {',
' "vs.languages.typescript": {',
' "validationSettings": [{',
' "scope":"/",',
' "noImplicitAny":true,',
' "noLib":false,',
' "extraLibs":[],',
' "semanticValidation":true,',
' "syntaxValidation":true,',
' "codeGenTarget":"ES5",',
' "moduleGenTarget":"",',
' "lint": {',
' "emptyBlocksWithoutComment": "warning",',
' "curlyBracketsMustNotBeOmitted": "warning",',
' "comparisonOperatorsNotStrict": "warning",',
' "missingSemicolon": "warning",',
' "unknownTypeOfResults": "warning",',
' "semicolonsInsteadOfBlocks": "warning",',
' "functionsInsideLoops": "warning",',
' "functionsWithoutReturnType": "warning",',
' "tripleSlashReferenceAlike": "warning",',
' "unusedImports": "warning",',
' "unusedVariables": "warning",',
' "unusedFunctions": "warning",',
' "unusedMembers": "warning"',
' }',
' },',
' {',
' "scope":"/client",',
' "baseUrl":"/client",',
' "moduleGenTarget":"amd"',
' },',
' {',
' "scope":"/server",',
' "moduleGenTarget":"commonjs"',
' },',
' {',
' "scope":"/build",',
' "moduleGenTarget":"commonjs"',
' },',
' {',
' "scope":"/node_modules/nake",',
' "moduleGenTarget":"commonjs"',
' }],',
' "allowMultipleWorkers": true',
' }',
' }',
'}',
'name: Apple',
'age: 18.0'
].join('\n'),
language: 'yaml'
});