prettier/tests/method-chain/__snapshots__/jsfmt.spec.js.snap

304 lines
8.0 KiB
Plaintext
Raw Normal View History

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`break-last-call.js 1`] = `
"export default store => {
return callApi(endpoint, schema).then(
response => next(actionWith({
response,
type: successType
})),
error => next(actionWith({
type: failureType,
error: error.message || 'Something bad happened'
}))
)
}
it('should group messages with same created time', () => {
expect(
groupMessages(messages).toJS(),
).toEqual({
'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'},
],
'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'},
],
'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'},
],
'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'},
],
});
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export default store => {
return callApi(endpoint, schema).then(
response => next(
actionWith({
response,
type: successType
})
),
error => next(
actionWith({
type: failureType,
error: error.message || \\"Something bad happened\\"
})
)
);
};
it(\\"should group messages with same created time\\", () => {
expect(groupMessages(messages).toJS()).toEqual({
\\"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\\"
}
],
\\"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\\"
}
],
\\"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\\"
}
],
\\"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\\"
}
]
});
});
"
`;
exports[`comment.js 1`] = `
"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);
}
"
`;
exports[`first_long.js 1`] = `
"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));
}
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 || [];
}
);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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));
}
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 || [];
});
}
"
`;
exports[`inline_merge.js 1`] = `
"Object.keys(
availableLocales({
test: true
})
)
.forEach(locale => {
// ...
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Object.keys(
availableLocales({
test: true
})
).forEach(locale => {
// ...
});
"
`;
exports[`multiple-members.js 1`] = `
"if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") {
describe(\\"POST /users/me/pet\\", function() {
it(\\"saves pet\\", function() {
function assert(pet) {
expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({
AddressLine1: \\"Alexanderstrasse\\",
AddressLine2: \\"\\",
PostalCode: \\"10999\\",
Region: \\"Berlin\\",
City: \\"Berlin\\",
Country: \\"DE\\"
});
}
});
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") {
describe(\\"POST /users/me/pet\\", function() {
it(\\"saves pet\\", function() {
function assert(pet) {
expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({
AddressLine1: \\"Alexanderstrasse\\",
AddressLine2: \\"\\",
PostalCode: \\"10999\\",
Region: \\"Berlin\\",
City: \\"Berlin\\",
Country: \\"DE\\"
});
}
});
});
}
"
`;
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();
"
`;
exports[`test.js 1`] = `
"method().then(x => x)
[\\"abc\\"](x => x)
[abc](x => x);
({}.a().b());
({}).a().b();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
method().then(x => x)[\\"abc\\"](x => x)[abc](x => x);
({}).a().b();
({}).a().b();
"
`;
exports[`this.js 1`] = `
"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);
"
`;