mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-12 17:17:27 +01:00
5a1bfaebbf
Closes #10 Closes #12
49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
// Copyright 2018 Google Inc. Use of this source code is governed by an
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
@TestOn('node')
|
|
@Tags(const ['node'])
|
|
|
|
import 'dart:js_util';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
import '../api.dart';
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
group("from a parameter", () {
|
|
test("true is true", () {
|
|
var value = parseValue<NodeSassBoolean>("true");
|
|
expect(value, isJSInstanceOf(sass.types.Boolean));
|
|
expect(value.getValue(), isTrue);
|
|
});
|
|
|
|
test("false is false", () {
|
|
var value = parseValue<NodeSassBoolean>("false");
|
|
expect(value, isJSInstanceOf(sass.types.Boolean));
|
|
expect(value.getValue(), isFalse);
|
|
});
|
|
});
|
|
|
|
group("from a constant", () {
|
|
test("true is true", () {
|
|
var value = sass.types.Boolean.TRUE;
|
|
expect(value, isJSInstanceOf(sass.types.Boolean));
|
|
expect(value.getValue(), isTrue);
|
|
});
|
|
|
|
test("false is false", () {
|
|
var value = sass.types.Boolean.FALSE;
|
|
expect(value, isJSInstanceOf(sass.types.Boolean));
|
|
expect(value.getValue(), isFalse);
|
|
});
|
|
});
|
|
|
|
test("the constructor throws", () {
|
|
expect(
|
|
() => callConstructor(sass.types.Boolean, [true]), throwsA(anything));
|
|
});
|
|
}
|