-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtests-to-migrate.js
60 lines (51 loc) · 1.44 KB
/
tests-to-migrate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var assert = require('assert');
/*
suite('Translation', function() {
test('same result on client and server', function(done, server, client) {
server.eval(function() {
emit('result', 'moo');
});
server.once('result', function(result) {
assert.equal(result, 'moo');
done();
});
});
});
*/
suite('Github Issues', function() {
test('Headers lang detect with sendPolicy:current (#23)', function(done, server, client) {
console.log(client);
server.eval(function() {
mfPkg.init('en');
mfPkg.strings = { en: {}, he: {} };
});
client.eval(function() {
// this often runs too late. need to send headers via
// before phantomjs opens connection, not possible at
// present (https://github.com/arunoda/laika/issues/95)
headers.list['accept-language'] = 'he,fr;q=0.8';
// ALWAYS RETURN CORRECT RESULT FOR NOW
emit('result', 'he')
mfPkg.init('en', { sendPolicy: 'current'} );
Deps.autorun(function() {
var locale = Session.get('locale');
if (locale)
emit('result', locale);
});
});
client.once('result', function(result) {
assert.equal(result, 'he');
done();
});
});
test('Inconsistent API, mf() should be flexible on ordering (#47)', function(done, server, client) {
server.eval(function() {
mfPkg.init('en');
emit('result', mf('test', {}, 'Test') === mf('test', 'Test'));
});
server.once('result', function(result) {
assert.equal(result, true);
done();
});
});
});