From c8fada7418e125fb216f200ad50ca92e2cecaa20 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Fri, 30 Jun 2023 23:18:21 -0500 Subject: [PATCH] test(integration): backfilled coverage for creation of the editorconfig file for #1275 --- test/integration/features/scaffold.feature | 5 ++++ .../step_definitions/config-steps.mjs | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/integration/features/scaffold.feature create mode 100644 test/integration/features/step_definitions/config-steps.mjs diff --git a/test/integration/features/scaffold.feature b/test/integration/features/scaffold.feature new file mode 100644 index 00000000..e0f4d61c --- /dev/null +++ b/test/integration/features/scaffold.feature @@ -0,0 +1,5 @@ +Feature: Scaffold + + Scenario: simple project + When the project is scaffolded + Then basic configuration is added diff --git a/test/integration/features/step_definitions/config-steps.mjs b/test/integration/features/step_definitions/config-steps.mjs new file mode 100644 index 00000000..cdbb461b --- /dev/null +++ b/test/integration/features/step_definitions/config-steps.mjs @@ -0,0 +1,23 @@ +import {promises as fs} from 'fs'; + +import {Then} from '@cucumber/cucumber'; +import {assert} from 'chai'; + +Then('basic configuration is added', async function () { + assert.equal( + await fs.readFile(`${process.cwd()}/.editorconfig`, 'utf-8'), + `# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +` + ); +});