有没有办法确认从树(左侧)删除文件或从上下文菜单中删除选项?
很容易错过ie 而是rename
点击delete file
.然后文件消失了.
我用谷歌搜索,发现它应该被移动到垃圾文件夹,但要么不适用于Win7或使用网络驱动器.因此,文件实际上被删除或移动到目前为止我无法跟踪它们的地方.
使用Sublime Text(build 3083)
我现在被困住了一段时间试图让单元测试设置和运行.
我有一个AngularJS前端加载了RequireJS和r.js优化生产,所以它在一个单独的文件中很好.这有效!
什么不起作用是执行单元测试.到目前为止,这并不奇怪,只是从教程中复制了一个启动器.
tests/user/user.test.js
:
define(['angular', 'angular-mocks', 'app'], function(angular, app) {
describe('Unit: UserController', function() {
beforeEach(module('user.app'));
it('should do something', function() {
console.log('did it');
});
});
});
Run Code Online (Sandbox Code Playgroud)
然后我有一个karma.conf.js
:
module.exports = function(config) {
config.set({
logLevel: config.LOG_DEBUG,
basePath: './',
files: [
// r.js'd app files
{pattern: 'dist/app.js', included: false},
// the tests
{pattern: 'tests/**/*.test.js', included: true},
],
excluded: ['tests/main.test.js']
frameworks: ['jasmine', 'requirejs'],
browsers: ['PhantomJS'],
plugins: [
'karma-jasmine',
'karma-junit-reporter',
'karma-phantomjs-launcher',
'karma-requirejs'
],
});
};
Run Code Online (Sandbox Code Playgroud)
答main.test.js
:
var allTestFiles = [];
var …
Run Code Online (Sandbox Code Playgroud) 我使用 Zod 定义架构并从架构推断类型。我更喜欢在嵌套对象时定义一个新模式,例如myObjectSchema
属性content
。
const myObjectSchema = z.object({
id: z.string(),
message: z.string(),
});
export type MyObject = z.infer<typeof myObjectSchema>;
const myWrapperSchema = z.object({
id: z.string(),
content: myObjectSchema,
});
export type MyWrapper = z.infer<typeof myWrapperSchema>;
Run Code Online (Sandbox Code Playgroud)
Zod(至少默认情况下)返回一个嵌套结构。
有没有办法给 Zod 提供类型,以便它在 ie VS Code 中显示嵌套类型名称而不是类型的结构?(仅使用类型或接口时就像这样)
我想避免同时编写类型和模式。
提前致谢!