2017-02-22 00:59:19 +03:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
exports[`break-last-call.js 1`] = `
|
2017-01-31 23:32:42 +03:00
|
|
|
"export default store => {
|
|
|
|
return callApi(endpoint, schema).then(
|
|
|
|
response => next(actionWith({
|
|
|
|
response,
|
|
|
|
type: successType
|
|
|
|
})),
|
|
|
|
error => next(actionWith({
|
|
|
|
type: failureType,
|
2017-02-22 00:59:19 +03:00
|
|
|
error: error.message || 'Something bad happened'
|
2017-01-31 23:32:42 +03:00
|
|
|
}))
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
it('should group messages with same created time', () => {
|
2017-01-31 23:32:42 +03:00
|
|
|
expect(
|
|
|
|
groupMessages(messages).toJS(),
|
|
|
|
).toEqual({
|
2017-02-22 00:59:19 +03:00
|
|
|
'11/01/2017 13:36': [
|
|
|
|
{message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:36'},
|
|
|
|
{message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:36'},
|
2017-01-31 23:32:42 +03:00
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
'09/01/2017 17:25': [
|
|
|
|
{message: 'te', messageType: 'SMS', status: 'Unknown', created: '09/01/2017 17:25'},
|
|
|
|
{message: 'te', messageType: 'Email', status: 'Unknown', created: '09/01/2017 17:25'},
|
2017-01-31 23:32:42 +03:00
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
'11/01/2017 13:33': [
|
|
|
|
{message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:33'},
|
|
|
|
{message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:33'},
|
2017-01-31 23:32:42 +03:00
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
'11/01/2017 13:37': [
|
|
|
|
{message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:37'},
|
|
|
|
{message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:37'},
|
2017-01-31 23:32:42 +03:00
|
|
|
],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
export default store => {
|
|
|
|
return callApi(endpoint, schema).then(
|
|
|
|
response => next(
|
|
|
|
actionWith({
|
|
|
|
response,
|
|
|
|
type: successType
|
|
|
|
})
|
|
|
|
),
|
|
|
|
error => next(
|
|
|
|
actionWith({
|
|
|
|
type: failureType,
|
2017-02-22 00:59:19 +03:00
|
|
|
error: error.message || \\"Something bad happened\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
it(\\"should group messages with same created time\\", () => {
|
2017-01-31 23:32:42 +03:00
|
|
|
expect(groupMessages(messages).toJS()).toEqual({
|
2017-02-22 00:59:19 +03:00
|
|
|
\\"11/01/2017 13:36\\": [
|
2017-01-31 23:32:42 +03:00
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"SMS\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:36\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
},
|
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"Email\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:36\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
}
|
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
\\"09/01/2017 17:25\\": [
|
2017-01-31 23:32:42 +03:00
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"te\\",
|
|
|
|
messageType: \\"SMS\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"09/01/2017 17:25\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
},
|
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"te\\",
|
|
|
|
messageType: \\"Email\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"09/01/2017 17:25\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
}
|
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
\\"11/01/2017 13:33\\": [
|
2017-01-31 23:32:42 +03:00
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"SMS\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:33\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
},
|
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"Email\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:33\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
}
|
|
|
|
],
|
2017-02-22 00:59:19 +03:00
|
|
|
\\"11/01/2017 13:37\\": [
|
2017-01-31 23:32:42 +03:00
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"SMS\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:37\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
},
|
|
|
|
{
|
2017-02-22 00:59:19 +03:00
|
|
|
message: \\"test\\",
|
|
|
|
messageType: \\"Email\\",
|
|
|
|
status: \\"Unknown\\",
|
|
|
|
created: \\"11/01/2017 13:37\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
exports[`comment.js 1`] = `
|
2017-02-13 20:05:18 +03:00
|
|
|
"function f() {
|
|
|
|
return observableFromSubscribeFunction()
|
|
|
|
// Debounce manually rather than using editor.onDidStopChanging so that the debounce time is
|
|
|
|
// configurable.
|
|
|
|
.debounceTime(debounceInterval);
|
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
function f() {
|
|
|
|
return observableFromSubscribeFunction()
|
|
|
|
// Debounce manually rather than using editor.onDidStopChanging so that the debounce time is
|
|
|
|
// configurable.
|
|
|
|
.debounceTime(debounceInterval);
|
|
|
|
}
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
exports[`first_long.js 1`] = `
|
2017-02-13 18:07:33 +03:00
|
|
|
"export default function theFunction(action$, store) {
|
|
|
|
return action$.ofType(THE_ACTION).switchMap(action => Observable
|
|
|
|
.webSocket({
|
|
|
|
url: THE_URL,
|
|
|
|
more: stuff(),
|
|
|
|
evenMore: stuff({
|
|
|
|
value1: true,
|
|
|
|
value2: false,
|
|
|
|
value3: false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.filter(data => theFilter(data))
|
|
|
|
.map(({ theType, ...data }) => theMap(theType, data))
|
|
|
|
.retryWhen(errors => errors));
|
|
|
|
}
|
2017-02-23 17:41:44 +03:00
|
|
|
|
|
|
|
function f() {
|
|
|
|
return this._getWorker(workerOptions)({
|
|
|
|
filePath,
|
|
|
|
hasteImplModulePath: this._options.hasteImplModulePath,
|
|
|
|
}).then(
|
|
|
|
metadata => {
|
|
|
|
// \`1\` for truthy values instead of \`true\` to save cache space.
|
|
|
|
fileMetadata[H.VISITED] = 1;
|
|
|
|
const metadataId = metadata.id;
|
|
|
|
const metadataModule = metadata.module;
|
|
|
|
if (metadataId && metadataModule) {
|
|
|
|
fileMetadata[H.ID] = metadataId;
|
|
|
|
setModule(metadataId, metadataModule);
|
|
|
|
}
|
|
|
|
fileMetadata[H.DEPENDENCIES] = metadata.dependencies || [];
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2017-02-13 18:07:33 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
export default function theFunction(action$, store) {
|
2017-02-23 17:41:44 +03:00
|
|
|
return action$.ofType(THE_ACTION).switchMap(action => Observable.webSocket({
|
2017-02-28 18:55:32 +03:00
|
|
|
url: THE_URL,
|
|
|
|
more: stuff(),
|
|
|
|
evenMore: stuff({
|
|
|
|
value1: true,
|
|
|
|
value2: false,
|
|
|
|
value3: false
|
2017-02-13 18:07:33 +03:00
|
|
|
})
|
2017-02-28 18:55:32 +03:00
|
|
|
})
|
2017-02-13 18:07:33 +03:00
|
|
|
.filter(data => theFilter(data))
|
|
|
|
.map(({ theType, ...data }) => theMap(theType, data))
|
|
|
|
.retryWhen(errors => errors));
|
|
|
|
}
|
2017-02-23 17:41:44 +03:00
|
|
|
|
|
|
|
function f() {
|
|
|
|
return this._getWorker(workerOptions)({
|
2017-02-28 18:55:32 +03:00
|
|
|
filePath,
|
|
|
|
hasteImplModulePath: this._options.hasteImplModulePath
|
|
|
|
}).then(metadata => {
|
|
|
|
// \`1\` for truthy values instead of \`true\` to save cache space.
|
|
|
|
fileMetadata[H.VISITED] = 1;
|
|
|
|
const metadataId = metadata.id;
|
|
|
|
const metadataModule = metadata.module;
|
|
|
|
if (metadataId && metadataModule) {
|
|
|
|
fileMetadata[H.ID] = metadataId;
|
|
|
|
setModule(metadataId, metadataModule);
|
|
|
|
}
|
|
|
|
fileMetadata[H.DEPENDENCIES] = metadata.dependencies || [];
|
|
|
|
});
|
2017-02-23 17:41:44 +03:00
|
|
|
}
|
2017-02-13 18:07:33 +03:00
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-28 18:55:32 +03:00
|
|
|
exports[`inline_merge.js 1`] = `
|
|
|
|
"Object.keys(
|
|
|
|
availableLocales({
|
|
|
|
test: true
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.forEach(locale => {
|
|
|
|
// ...
|
|
|
|
});
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Object.keys(
|
|
|
|
availableLocales({
|
|
|
|
test: true
|
|
|
|
})
|
|
|
|
).forEach(locale => {
|
|
|
|
// ...
|
|
|
|
});
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
exports[`multiple-members.js 1`] = `
|
|
|
|
"if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") {
|
|
|
|
describe(\\"POST /users/me/pet\\", function() {
|
|
|
|
it(\\"saves pet\\", function() {
|
2017-01-31 23:32:42 +03:00
|
|
|
function assert(pet) {
|
2017-02-22 00:59:19 +03:00
|
|
|
expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({
|
|
|
|
AddressLine1: \\"Alexanderstrasse\\",
|
|
|
|
AddressLine2: \\"\\",
|
|
|
|
PostalCode: \\"10999\\",
|
|
|
|
Region: \\"Berlin\\",
|
|
|
|
City: \\"Berlin\\",
|
|
|
|
Country: \\"DE\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-22 00:59:19 +03:00
|
|
|
if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") {
|
|
|
|
describe(\\"POST /users/me/pet\\", function() {
|
|
|
|
it(\\"saves pet\\", function() {
|
2017-01-31 23:32:42 +03:00
|
|
|
function assert(pet) {
|
2017-02-22 00:59:19 +03:00
|
|
|
expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({
|
|
|
|
AddressLine1: \\"Alexanderstrasse\\",
|
|
|
|
AddressLine2: \\"\\",
|
|
|
|
PostalCode: \\"10999\\",
|
|
|
|
Region: \\"Berlin\\",
|
|
|
|
City: \\"Berlin\\",
|
|
|
|
Country: \\"DE\\"
|
2017-01-31 23:32:42 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-23 18:34:52 +03:00
|
|
|
exports[`square_0.js 1`] = `
|
|
|
|
"const version = someLongString
|
|
|
|
.split('jest version =')
|
|
|
|
.pop()
|
|
|
|
.split(EOL)[0]
|
|
|
|
.trim();
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
const version = someLongString
|
|
|
|
.split(\\"jest version =\\")
|
|
|
|
.pop()
|
|
|
|
.split(EOL)[0]
|
|
|
|
.trim();
|
|
|
|
"
|
|
|
|
`;
|
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
exports[`test.js 1`] = `
|
2017-01-25 01:35:37 +03:00
|
|
|
"method().then(x => x)
|
2017-02-22 00:59:19 +03:00
|
|
|
[\\"abc\\"](x => x)
|
2017-01-25 01:35:37 +03:00
|
|
|
[abc](x => x);
|
|
|
|
|
|
|
|
({}.a().b());
|
|
|
|
({}).a().b();
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-02-22 00:59:19 +03:00
|
|
|
method().then(x => x)[\\"abc\\"](x => x)[abc](x => x);
|
2017-01-25 01:35:37 +03:00
|
|
|
|
|
|
|
({}).a().b();
|
|
|
|
({}).a().b();
|
|
|
|
"
|
|
|
|
`;
|
2017-02-04 00:18:54 +03:00
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
exports[`this.js 1`] = `
|
2017-02-04 00:18:54 +03:00
|
|
|
"const sel = this.connections
|
|
|
|
.concat(this.activities.concat(this.operators))
|
|
|
|
.filter(x => x.selected);
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
const sel = this.connections
|
|
|
|
.concat(this.activities.concat(this.operators))
|
|
|
|
.filter(x => x.selected);
|
|
|
|
"
|
|
|
|
`;
|