Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-15 02:05:22 +00:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
@@ -18,24 +18,24 @@ LinkedUrlProxy.get('/', (req, res, next) => {
}
})
describe('LinkedFiles', function() {
describe('LinkedFiles', function () {
let projectOne, projectOneId, projectOneRootFolderId
let projectTwo, projectTwoId, projectTwoRootFolderId
let sourceDocName = 'test.txt'
let owner
before(function(done) {
before(function (done) {
LinkedUrlProxy.listen(6543, done)
})
beforeEach(async function() {
beforeEach(async function () {
owner = new User()
await owner.login()
await promisify(mkdirp)(Settings.path.dumpFolder)
})
describe('creating a project linked file', function() {
beforeEach(async function() {
describe('creating a project linked file', function () {
beforeEach(async function () {
projectOneId = await owner.createProject('plf-test-one', {
template: 'blank'
})
@@ -60,7 +60,7 @@ describe('LinkedFiles', function() {
)
})
it('should produce a list of the users projects and their entities', async function() {
it('should produce a list of the users projects and their entities', async function () {
let { body } = await owner.doRequest('get', {
url: '/user/projects',
json: true
@@ -94,7 +94,7 @@ describe('LinkedFiles', function() {
})
})
it('should import a file and refresh it if there is no v1 id', async function() {
it('should import a file and refresh it if there is no v1 id', async function () {
// import the file from the source project
let { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file`,
@@ -156,8 +156,8 @@ describe('LinkedFiles', function() {
})
})
describe('with a linked project_file from a v1 project that has not been imported', function() {
beforeEach(async function() {
describe('with a linked project_file from a v1 project that has not been imported', function () {
beforeEach(async function () {
projectOneId = await owner.createProject('plf-v1-test-one', {
template: 'blank'
})
@@ -177,7 +177,7 @@ describe('LinkedFiles', function() {
await owner.saveProject(projectOne)
})
it('should refuse to refresh', async function() {
it('should refuse to refresh', async function () {
const { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file/abcd/refresh`,
json: true
@@ -189,8 +189,8 @@ describe('LinkedFiles', function() {
})
})
describe('creating a URL based linked file', function() {
beforeEach(async function() {
describe('creating a URL based linked file', function () {
beforeEach(async function () {
projectOneId = await owner.createProject('url-linked-files-project', {
template: 'blank'
})
@@ -198,7 +198,7 @@ describe('LinkedFiles', function() {
projectOneRootFolderId = projectOne.rootFolder[0]._id.toString()
})
it('should download, create and replace a file', async function() {
it('should download, create and replace a file', async function () {
// downloading the initial file
let { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file`,
@@ -266,7 +266,7 @@ describe('LinkedFiles', function() {
expect(body).to.equal('bar bar bar')
})
it("should return an error if the file can't be downloaded", async function() {
it("should return an error if the file can't be downloaded", async function () {
// download does not succeed
let { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file`,
@@ -319,7 +319,7 @@ describe('LinkedFiles', function() {
)
})
it('should accept a URL withuot a leading http://, and add it', async function() {
it('should accept a URL withuot a leading http://, and add it', async function () {
let { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file`,
json: {
@@ -355,8 +355,8 @@ describe('LinkedFiles', function() {
// TODO: Add test for asking for host that return ENOTFOUND
// (This will probably end up handled by the proxy)
describe('creating a linked output file', function() {
beforeEach(async function() {
describe('creating a linked output file', function () {
beforeEach(async function () {
projectOneId = await owner.createProject('output-test-one', {
template: 'blank'
})
@@ -370,7 +370,7 @@ describe('LinkedFiles', function() {
projectTwoRootFolderId = projectTwo.rootFolder[0]._id.toString()
})
it('should import the project.pdf file from the source project and refresh it', async function() {
it('should import the project.pdf file from the source project and refresh it', async function () {
// import the file
let { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file`,
@@ -417,8 +417,8 @@ describe('LinkedFiles', function() {
})
})
describe('with a linked project_output_file from a v1 project that has not been imported', function() {
beforeEach(async function() {
describe('with a linked project_output_file from a v1 project that has not been imported', function () {
beforeEach(async function () {
projectOneId = await owner.createProject('output-v1-test-one', {
template: 'blank'
})
@@ -439,7 +439,7 @@ describe('LinkedFiles', function() {
await owner.saveProject(projectOne)
})
it('should refuse to refresh', async function() {
it('should refuse to refresh', async function () {
const { response, body } = await owner.doRequest('post', {
url: `/project/${projectOneId}/linked_file/abcdef/refresh`,
json: true