@@ -14,9 +14,9 @@ describe('Action', () => {
14
14
it ( 'works with create' , ( ) => {
15
15
const actions = new ActionList ;
16
16
17
- actions . create ( normalize ( '/a/b' ) , new Buffer ( '1' ) ) ;
18
- actions . create ( normalize ( '/a/c' ) , new Buffer ( '2' ) ) ;
19
- actions . create ( normalize ( '/a/c' ) , new Buffer ( '3' ) ) ;
17
+ actions . create ( normalize ( '/a/b' ) , Buffer . from ( '1' ) ) ;
18
+ actions . create ( normalize ( '/a/c' ) , Buffer . from ( '2' ) ) ;
19
+ actions . create ( normalize ( '/a/c' ) , Buffer . from ( '3' ) ) ;
20
20
21
21
expect ( actions . length ) . toBe ( 3 ) ;
22
22
actions . optimize ( ) ;
@@ -25,10 +25,10 @@ describe('Action', () => {
25
25
it ( 'works with overwrite' , ( ) => {
26
26
const actions = new ActionList ;
27
27
28
- actions . create ( normalize ( '/a/b' ) , new Buffer ( '1' ) ) ;
29
- actions . create ( normalize ( '/a/c' ) , new Buffer ( '2' ) ) ;
30
- actions . overwrite ( normalize ( '/a/c' ) , new Buffer ( '3' ) ) ;
31
- actions . overwrite ( normalize ( '/a/b' ) , new Buffer ( '4' ) ) ;
28
+ actions . create ( normalize ( '/a/b' ) , Buffer . from ( '1' ) ) ;
29
+ actions . create ( normalize ( '/a/c' ) , Buffer . from ( '2' ) ) ;
30
+ actions . overwrite ( normalize ( '/a/c' ) , Buffer . from ( '3' ) ) ;
31
+ actions . overwrite ( normalize ( '/a/b' ) , Buffer . from ( '4' ) ) ;
32
32
33
33
expect ( actions . length ) . toBe ( 4 ) ;
34
34
actions . optimize ( ) ;
@@ -38,11 +38,11 @@ describe('Action', () => {
38
38
it ( 'works with cloning a list' , ( ) => {
39
39
const actions = new ActionList ;
40
40
41
- actions . create ( normalize ( '/a/b' ) , new Buffer ( '1' ) ) ;
42
- actions . create ( normalize ( '/a/c' ) , new Buffer ( '2' ) ) ;
43
- actions . overwrite ( normalize ( '/a/c' ) , new Buffer ( '3' ) ) ;
44
- actions . overwrite ( normalize ( '/a/b' ) , new Buffer ( '4' ) ) ;
45
- actions . create ( normalize ( '/a/d' ) , new Buffer ( '5' ) ) ;
41
+ actions . create ( normalize ( '/a/b' ) , Buffer . from ( '1' ) ) ;
42
+ actions . create ( normalize ( '/a/c' ) , Buffer . from ( '2' ) ) ;
43
+ actions . overwrite ( normalize ( '/a/c' ) , Buffer . from ( '3' ) ) ;
44
+ actions . overwrite ( normalize ( '/a/b' ) , Buffer . from ( '4' ) ) ;
45
+ actions . create ( normalize ( '/a/d' ) , Buffer . from ( '5' ) ) ;
46
46
47
47
const actions2 = new ActionList ;
48
48
actions . forEach ( x => actions2 . push ( x ) ) ;
@@ -59,10 +59,10 @@ describe('Action', () => {
59
59
it ( 'handles edge cases (1)' , ( ) => {
60
60
const actions = new ActionList ;
61
61
62
- actions . create ( normalize ( '/test' ) , new Buffer ( '1' ) ) ;
63
- actions . overwrite ( normalize ( '/test' ) , new Buffer ( '3' ) ) ;
64
- actions . overwrite ( normalize ( '/hello' ) , new Buffer ( '2' ) ) ;
65
- actions . overwrite ( normalize ( '/test' ) , new Buffer ( '4' ) ) ;
62
+ actions . create ( normalize ( '/test' ) , Buffer . from ( '1' ) ) ;
63
+ actions . overwrite ( normalize ( '/test' ) , Buffer . from ( '3' ) ) ;
64
+ actions . overwrite ( normalize ( '/hello' ) , Buffer . from ( '2' ) ) ;
65
+ actions . overwrite ( normalize ( '/test' ) , Buffer . from ( '4' ) ) ;
66
66
67
67
const actions2 = new ActionList ;
68
68
actions . forEach ( x => actions2 . push ( x ) ) ;
@@ -79,9 +79,9 @@ describe('Action', () => {
79
79
it ( 'handles edge cases (2)' , ( ) => {
80
80
const actions = new ActionList ;
81
81
82
- actions . create ( normalize ( '/test' ) , new Buffer ( '1' ) ) ;
82
+ actions . create ( normalize ( '/test' ) , Buffer . from ( '1' ) ) ;
83
83
actions . rename ( normalize ( '/test' ) , normalize ( '/test1' ) ) ;
84
- actions . overwrite ( normalize ( '/test1' ) , new Buffer ( '2' ) ) ;
84
+ actions . overwrite ( normalize ( '/test1' ) , Buffer . from ( '2' ) ) ;
85
85
actions . rename ( normalize ( '/test1' ) , normalize ( '/test2' ) ) ;
86
86
87
87
actions . optimize ( ) ;
@@ -95,7 +95,7 @@ describe('Action', () => {
95
95
const actions = new ActionList ;
96
96
97
97
actions . rename ( normalize ( '/test' ) , normalize ( '/test1' ) ) ;
98
- actions . overwrite ( normalize ( '/test1' ) , new Buffer ( '2' ) ) ;
98
+ actions . overwrite ( normalize ( '/test1' ) , Buffer . from ( '2' ) ) ;
99
99
actions . rename ( normalize ( '/test1' ) , normalize ( '/test2' ) ) ;
100
100
101
101
actions . optimize ( ) ;
0 commit comments