diff --git a/packages/fxa-auth-server/lib/senders/emails/sass-compile-files.ts b/packages/fxa-auth-server/lib/senders/emails/sass-compile-files.ts index 70680755e8c..d81ef2ec092 100644 --- a/packages/fxa-auth-server/lib/senders/emails/sass-compile-files.ts +++ b/packages/fxa-auth-server/lib/senders/emails/sass-compile-files.ts @@ -3,13 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { renderSync } from 'sass'; -import { - writeFileSync, - mkdirSync, - existsSync, - rmdirSync, - readdirSync, -} from 'fs'; +import { writeFileSync, mkdirSync, existsSync, rmSync, readdirSync } from 'fs'; import path from 'path'; const getDirectories = (source: string) => @@ -23,22 +17,21 @@ const templates = getDirectories(path.join(__dirname, 'templates')); const layouts = getDirectories(path.join(__dirname, 'layouts')); async function compileSass(dir: string, subdir: string) { - let styleResult: Record = {}; try { - styleResult = renderSync({ + const styleResult = renderSync({ file: dir, outFile: subdir, }); + writeFileSync(subdir, styleResult.css, 'utf8'); } catch (e) { - console.log(e); + console.error(e); } - writeFileSync(subdir, styleResult.css, 'utf8'); } async function main(directories: Record) { // remove css directory if already present if (existsSync(path.join(__dirname, 'css'))) { - rmdirSync(path.join(__dirname, 'css'), { recursive: true }); + rmSync(path.join(__dirname, 'css'), { recursive: true, force: true }); } mkdirSync(path.join(__dirname, 'css')); diff --git a/packages/fxa-auth-server/test/oauth/api.js b/packages/fxa-auth-server/test/oauth/api.js index cfe1d20d5ba..15a26660544 100644 --- a/packages/fxa-auth-server/test/oauth/api.js +++ b/packages/fxa-auth-server/test/oauth/api.js @@ -2064,7 +2064,10 @@ describe('#integration - /v1', function () { assert.equal(res.statusCode, 200); assertSecurityHeaders(res); - assert.equal(res.result.scope, 'email https://identity.mozilla.com/apps/notes'); + assert.equal( + res.result.scope, + 'email https://identity.mozilla.com/apps/notes' + ); }); }); }); @@ -2296,7 +2299,10 @@ describe('#integration - /v1', function () { assert.equal(res.statusCode, 200); assert.ok(res.result.access_token); // Should contain all requested scopes (including invalid ones) - assert.equal(res.result.scope, 'profile email invalid:scope another:invalid'); + assert.equal( + res.result.scope, + 'profile email invalid:scope another:invalid' + ); }); }); }); @@ -3337,7 +3343,7 @@ describe('#integration - /v1', function () { assert.equal(clients2[0].client_id, client2Id.toString('hex')); }); - it('should seperately list different refresh tokens from the same client', async () => { + it('should separately list different refresh tokens from the same client', async () => { await makeAccessToken(client1, user1, ['profile']); await makeAccessToken(client1, user1, ['other', 'scope']); await makeRefreshToken(client2, user1, ['profile']);