我需要测试通过提供一个API HTTPS与mocha和super test
(证书都没有过期)
这是服务器的要点:
...
var app = express();
var _options = {
key: fs.readFileSync('my-key.pem');,
cert: fs.readFileSync('my-cert.pem')
};
// Start HTTPS server
https.createServer(_options, app).listen(app.get('port'), app.get('ip'), function () {
// ok or not logs
});
Run Code Online (Sandbox Code Playgroud)
这是要测试的路线
app.get('/hello',function (req, res) {
res.json(200);
});
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用此代码进行测试 test/test.js
var supertest = require('supertest'),
api = supertest('https://localhost:3000');
describe('Hello test', function () {
it('hello', function (done) {
api.get('/hello')
.expect(200)
.end(function (err, res) {
if (err) {
done(err);
} else {
done();
}
}); …Run Code Online (Sandbox Code Playgroud) 我想使用具有从函数返回的动态值的disabled-ng.
我尝试了几种方法,但它没有用.
<textarea id="{{exercise.type}}" ng-disabled={{prova}}></textarea>
......
<textarea id="{{exercise.type}}" ng-disabled=prova></textarea>
......
<textarea id="{{exercise.type}}" ng-disabled=prova()></textarea>
Run Code Online (Sandbox Code Playgroud)
有了这个javascript函数
$scope.prova=function(e){
return true;
};
Run Code Online (Sandbox Code Playgroud) 我使用Titanium(3.1.3)和Alloy实现了facebook登录.
但有时当我尝试登录时,我发送此消息错误.
message = "FBSession: should only be used from a single thread";
我有一个具有三个深度级别的数据模型。
var job = mongoose.Schema({
id:Number,
jobName:String
});
var demo = mongoose.Schema({
id:Number,
demoName:String,
job:[job]
});
var ExerciseSchema = mongoose.Schema({
id:Number,
name:String,
area:String,
medicalObj:[demo]
});
Run Code Online (Sandbox Code Playgroud)
var Exercise = mongoose.model('Exercise', ExerciseSchema);
我想在第二个嵌套数组中推送新对象
我正在尝试这种方式,但不起作用:
Exercise.update({'area':area},{$push:{"medicalObj.job":{jobName:'Andrea'}}},{upsert:true},function(err){
if(err){
console.log("ERROR" + err);
}else{
console.log("Successfully");
}
});
Run Code Online (Sandbox Code Playgroud) 我有一个scalable app在OpenShift与MongoDb2.2广告NodeJs0.10,
由于我无法使用,Cartridge rockmongo-1.1因为它无法嵌入可扩展的应用程序,
我怎样才能让我的db'documents,做一个Backup和Restore用ssh?
<SplitWindow id="home" platform="ios" formFactor="tablet">
<Require src="master" id="master"/>
<Require src="detail" id="detail"/>
</SplitWindow>
Run Code Online (Sandbox Code Playgroud)
strange behavior如果我black separation line在两个窗口之间水平拖动,我有一个.窗户改变大小适应我的动作.

而且,如果我更改width窗户更容易识别black separation line
function demo() {
Alloy.Globals.master.win.width = 512;
Alloy.Globals.detail.win.width = 512;
}
Run Code Online (Sandbox Code Playgroud)

[For test purpose you have to aim the exact pixel of the black separation line ]
你能说出为什么会发生这种情况,我该如何阻止这种行为?
我需要验证没有@和的昵称,#并且不能以数字开头
这是我的解决方案,但@和#
(^[^0-9])([\w a-z A-Z 0-9][^@#])
Run Code Online (Sandbox Code Playgroud)
。测试:
andrea //true
0andrea // false
// these are true but I need them to be false
and@rea // true
and#rea // true
Run Code Online (Sandbox Code Playgroud) 我正在开发一个基于MEAN堆栈的Web应用程序.我使用bootstrap作为css lib,并在我的"app.css"和"mio.css"的两个文件中有一些css覆盖,应用程序工作正常,直到我点击refresh处理两个部分的控制器,而不是一切都重新加载除了我的2个css文件.
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/mio.css">
Run Code Online (Sandbox Code Playgroud)
如果我检查它们,它们包含index.html数据(头部主体dcc)
你能建议发生什么事吗?