|
17 | 17 | * You should have received a copy of the GNU General Public License
|
18 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 | 19 | */
|
20 |
| - |
| 20 | +/* global beforeEach, afterEach */ |
21 | 21 | import { parseGrass, objToCss } from 'services/grassUtils'
|
22 | 22 |
|
23 | 23 | describe('parseGrass', () => {
|
@@ -50,6 +50,13 @@ describe('parseGrass', () => {
|
50 | 50 | })
|
51 | 51 |
|
52 | 52 | describe('objToCss', () => {
|
| 53 | + const origConsoleError = console.error |
| 54 | + beforeEach(() => { |
| 55 | + console.error = () => {} |
| 56 | + }) |
| 57 | + afterEach(() => { |
| 58 | + console.error = origConsoleError |
| 59 | + }) |
53 | 60 | it('should create CSS from obj', () => {
|
54 | 61 | const obj = {
|
55 | 62 | body: {
|
|
72 | 79 | const css = objToCss(obj)
|
73 | 80 |
|
74 | 81 | expect(css).toEqual(expected)
|
| 82 | + console.error = origConsoleError |
75 | 83 | })
|
76 | 84 | it('should create GraSS from obj', () => {
|
| 85 | + const origConsoleError = console.error |
| 86 | + console.error = () => {} |
77 | 87 | const obj = {
|
78 | 88 | node: {
|
79 | 89 | color: 'red',
|
@@ -107,6 +117,7 @@ relationship {
|
107 | 117 | const grass = objToCss(obj)
|
108 | 118 |
|
109 | 119 | expect(grass).toEqual(expected)
|
| 120 | + console.error = origConsoleError |
110 | 121 | })
|
111 | 122 | it('does not break on null', () => {
|
112 | 123 | const obj = null
|
|
0 commit comments