From 6626c5e37ad66eec58143bf5bb481812258efbf2 Mon Sep 17 00:00:00 2001 From: Joseph Frazier <1212jtraceur@gmail.com> Date: Mon, 17 Apr 2017 17:31:20 -0400 Subject: [PATCH] Add failing test for packing directories recursively https://github.com/yarnpkg/yarn/issues/2498 --- __tests__/commands/pack.js | 2 +- __tests__/fixtures/pack/files-include/dir/nested.js | 2 ++ __tests__/fixtures/pack/files-include/package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 __tests__/fixtures/pack/files-include/dir/nested.js diff --git a/__tests__/commands/pack.js b/__tests__/commands/pack.js index 8e4552ed35..8cdd891704 100644 --- a/__tests__/commands/pack.js +++ b/__tests__/commands/pack.js @@ -115,7 +115,7 @@ test.concurrent('pack should inlude all files listed in the files array', (): Pr path.join(cwd, 'files-include-v1.0.0.tgz'), path.join(cwd, 'files-include-v1.0.0'), ); - const expected = ['index.js', 'a.js', 'b.js']; + const expected = ['index.js', 'a.js', 'b.js', 'dir/nested.js']; expected.forEach((filename) => { expect(files.indexOf(filename)).toBeGreaterThanOrEqual(0); }); diff --git a/__tests__/fixtures/pack/files-include/dir/nested.js b/__tests__/fixtures/pack/files-include/dir/nested.js new file mode 100644 index 0000000000..66a7302f5c --- /dev/null +++ b/__tests__/fixtures/pack/files-include/dir/nested.js @@ -0,0 +1,2 @@ +/* @flow */ +console.log('hello world'); diff --git a/__tests__/fixtures/pack/files-include/package.json b/__tests__/fixtures/pack/files-include/package.json index 917dfeb6d2..f6819044fe 100644 --- a/__tests__/fixtures/pack/files-include/package.json +++ b/__tests__/fixtures/pack/files-include/package.json @@ -3,5 +3,5 @@ "version": "1.0.0", "main": "index.js", "license": "MIT", - "files": ["index.js", "a.js", "b.js"] + "files": ["index.js", "a.js", "b.js", "dir/"] }